Files
tangmo_trans_bot/set_web_hook.php
2022-09-30 01:53:10 +00:00

13 lines
376 B
PHP

<?php
require __DIR__ . '/vendor/autoload.php';
require __DIR__ . '/env.php';
try {
$telegram = new Longman\TelegramBot\Telegram($bot_api_key, $bot_username);
$result = $telegram->setWebhook($hook_url);
if ($result->isOk()) {
echo $result->getDescription();
}
} catch (Longman\TelegramBot\Exception\TelegramException $e) {
echo $e->getMessage();
}