Commit 991bfb72 authored by MBoretto's avatar MBoretto

example and read me

parent b45be4bf
......@@ -329,9 +329,9 @@ $telegram->setDownloadPath("yourpath/Download");
$telegram->setUploadPath("yourpath../Upload");
```
###Unset Webhook
Edit *example-unset.php* with your credential and execute it.
Edit *example/unset.php* with your credential and execute it.
### Logging
Thrown Exception are stored in TelegramException.log file (in the base directory).
Thrown Exception are stored in *TelegramException.log* file (in the base directory).
Incoming update (json string from webhook and getUpdates) can be logged on a text file, set those options with the methods:
```php
......
<?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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment