Skip to content

Commit

Permalink
added unset webhook example
Browse files Browse the repository at this point in the history
  • Loading branch information
MBoretto committed Dec 9, 2015
1 parent cf301e8 commit f9a90f3
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions examples/unset.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
//Composer Loader
$loader = require __DIR__.'/vendor/autoload.php';

$API_KEY = 'your_bot_api_key';
$BOT_NAME = 'namebot';
try {
// create Telegram API object
$telegram = new Longman\TelegramBot\Telegram($API_KEY, $BOT_NAME);
// set webhook
$result = $telegram->unsetWebHook();
//Uncomment to use certificate
//$result = $telegram->setWebHook($link, $path_certificate);
if ($result->isOk()) {
echo $result->getDescription();
}
} catch (Longman\TelegramBot\Exception\TelegramException $e) {
echo $e;
}

0 comments on commit f9a90f3

Please sign in to comment.