S
S
Solomon Gennadievich2022-04-05 22:45:50
PHP
Solomon Gennadievich, 2022-04-05 22:45:50

How to make a greeting after the /start command in a Telegram bot?

How to make a greeting after the /start command in a Telegram bot? So that after this command my message comes out

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Shapoval, 2016-08-22
@AlexanderShapoval

A bit of shitty code). Suitable only for my case where only two encodings are possible

<?php

$str = "╨С╨░╤В╤М╨║╨░ ╨Ф╨╕╨│╨╗╨╛╨▓";

$ret = iconv("UTF-8", "CP866", $str);

echo var_dump(strlen($str));
echo var_dump(strlen($ret));

if (strlen($ret) < strlen($str)/2) {
  echo "New " . $ret;
} else {
  echo "Old " . $str;
}

S
shagguboy, 2016-08-22
@shagguboy

php.net/manual/en/function.mb-detect-encoding.php#...

D
Dmitry, 2022-04-06
@q2digger

You probably need to write the code for this bot somewhere, add a handler there that will respond to commands and somehow respond to messages. Well, run it somewhere.
Do you have a bot yourself? Or is it just a theoretical question?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question