forked from php-telegram-bot/example-bot
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathunset.php
More file actions
27 lines (22 loc) · 631 Bytes
/
unset.php
File metadata and controls
27 lines (22 loc) · 631 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
/**
* README
* This file is intended to unset the webhook.
* Uncommented parameters must be filled
*/
// Load composer
require_once __DIR__ . '/vendor/autoload.php';
// Add you bot's API key and name
$bot_api_key = 'your:bot_api_key';
$bot_username = 'username_bot';
try {
// Create Telegram API object
$telegram = new Longman\TelegramBot\Telegram($bot_api_key, $bot_username);
// Delete webhook
$result = $telegram->deleteWebhook();
if ($result->isOk()) {
echo $result->getDescription();
}
} catch (Longman\TelegramBot\Exception\TelegramException $e) {
echo $e->getMessage();
}