Skip to content

Commit f9a90f3

Browse files
committed
added unset webhook example
1 parent cf301e8 commit f9a90f3

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

examples/unset.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
//Composer Loader
3+
$loader = require __DIR__.'/vendor/autoload.php';
4+
5+
$API_KEY = 'your_bot_api_key';
6+
$BOT_NAME = 'namebot';
7+
try {
8+
// create Telegram API object
9+
$telegram = new Longman\TelegramBot\Telegram($API_KEY, $BOT_NAME);
10+
// set webhook
11+
$result = $telegram->unsetWebHook();
12+
//Uncomment to use certificate
13+
//$result = $telegram->setWebHook($link, $path_certificate);
14+
if ($result->isOk()) {
15+
echo $result->getDescription();
16+
}
17+
} catch (Longman\TelegramBot\Exception\TelegramException $e) {
18+
echo $e;
19+
}

0 commit comments

Comments
 (0)