setWebhook()
(документация) и назначить URL вашего сервера, куда будут приходить уведомления именно этого бота. Например https://api.example.com/webhook/{bot_id}
где bot_id – id бота в вашей БД. /start
бот не может ничего отправить. Но посетителю бота видно название бота и его описание – это заполняется через BotFather – см. /setdescription ./mtproto-proxy -u nobody -p 8888 -H 443 -S <secret> --aes-pwd proxy-secret proxy-multi.conf -M 1
... where:
nobody is the username. mtproto-proxy calls setuid() to drop privilegies.
443 is the port, used by clients to connect to the proxy.
8888 is the local port. You can use it to get statistics from mtproto-proxy. Like wget localhost:8888/stats. You can only get this stat via loopback.
<secret> is the secret generated at step 3. Also you can set multiple secrets: -S <secret1> -S <secret2>.
proxy-secret and proxy-multi.conf are obtained at steps 1 and 2.
1 is the number of workers. You can increase the number of workers, if you have a powerful server.
web.telegram.org
? chat.id
/**
* Webhook handler
*
* @return array
* @throws \TelegramBot\Api\InvalidJsonException
*/
public function run()
{
if ($data = BotApi::jsonValidate($this->getRawBody(), true)) {
$this->handle([Update::fromResponse($data)]);
}
}