php-telegram-bot / core

PHP Telegram Bot based on the official Telegram Bot API
MIT License
3.87k stars 951 forks source link

i have error with getUpdateCLI #279

Closed MPCL5 closed 8 years ago

MPCL5 commented 8 years ago

Warning: PDOStatement::execute(): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'u776080620_bot.telegram_update' doesn't exist in /home/u776080620/public_html/bot/vendor/longman/telegram-bot/src/DB.php on line 200 exception 'Longman\TelegramBot\Exception\TelegramException' with message 'Client error: POST https://api.telegram.org/bot234213012:*******************************/getUpdates resulted in a 409 Conflict response: {"ok":false,"error_code":409,"description":"Conflict: can't use getUpdates method while webhook is active"} ' in /home/u776080620/public_html/bot/vendor/longman/telegram-bot/src/Request.php:205 Stack trace: #0 /home/u776080620/public_html/bot/vendor/longman/telegram-bot/src/Request.php(296): Longman\TelegramBot\Request::execute('getUpdates', Array) #1 /home/u776080620/public_html/bot/vendor/longman/telegram-bot/src/Request.php(577): Longman\TelegramBot\Request::send('getUpdates', Array) #2 /home/u776080620/public_html/bot/vendor/longman/telegram-bot/src/Telegram.php(311): Longman\TelegramBot\Request::getUpdates(Array) #3 /home/u776080620/public_html/bot/getUpdatesCLI.php(57): Longman\TelegramBot\Telegram->handleGetUpdates() #4 {main}

noplanman commented 8 years ago

The error message says: "description":"Conflict: can't use getUpdates method while webhook is active"

This means, that you have a webhook active. To be able to use getUpdates, you first need to remove the webhook by using the unset.php file.

MPCL5 commented 8 years ago

How? Can you give an example?

noplanman commented 8 years ago

Get the examples/unset.php file and add your bot details. Now, when you call this file through your browser, you should get the "Webhook was deleted" message. This means that you can now use getUpdates method 👍