php-telegram-bot / core

PHP Telegram Bot based on the official Telegram Bot API
MIT License
3.9k stars 953 forks source link

Errors in logs #30

Closed vavoluk closed 9 years ago

vavoluk commented 9 years ago

There are some errors in logs when I'm trying to use any command (excluding /echo):

[Fri Sep 04 15:29:57 2015] [error] [client 149.154.167.198] PHP Warning:  Missing argument 2 for Longman\\TelegramBot\\Entities\\Message::__construct(), called in /home/vavoluk/bot/vendor/longman/telegram-bot/src/Entities/Message.php on line 107 and defined in /home/vavoluk/bot/vendor/longman/telegram-bot/src/Entities/Message.php on line 64
[Fri Sep 04 15:29:57 2015] [error] [client 149.154.167.198] PHP Notice:  Undefined variable: bot_name in /home/vavoluk/bot/vendor/longman/telegram-bot/src/Entities/Message.php on line 66

How to fix this?

akalongman commented 9 years ago

Pass bot username in new Telegram

vavoluk commented 9 years ago

I already pass api key and botname:

$API_KEY = 'MY_BOT_API_KEY';
$BOT_NAME = 'MY_BOT_NAME';
...
new Longman\TelegramBot\Telegram($API_KEY,$BOT_NAME)
...
vavoluk commented 9 years ago

Any idea how to fix this?

MBoretto commented 9 years ago

Thanks for reporting. Have you enable mysql or text logging? Could you reproduce the error and report us logs and update?(correlated to each other) I can't recognise the origin of the error with this information. On 6 Sep 2015 12:48, "vavoluk" notifications@github.com wrote:

Any idea how to fix this?

— Reply to this email directly or view it on GitHub https://github.com/akalongman/php-telegram-bot/issues/30#issuecomment-138068062 .

vavoluk commented 9 years ago

Yes, I have enabled both (mysql and text logging). Have the same errors in error log:

[Sun Sep 06 16:14:30 2015] [error] [client 149.154.167.198] PHP Warning:  Missing argument 2 for Longman\\TelegramBot\\Entities\\Message::__construct(), called in /home/vavoluk/bot/vendor/longman/telegram-bot/src/Entities/Message.php on line 107 and defined in /home/vavoluk/bot/vendor/longman/telegram-bot/src/Entities/Message.php on line 64
[Sun Sep 06 16:14:30 2015] [error] [client 149.154.167.198] PHP Notice:  Undefined variable: bot_name in /home/vavoluk/bot/vendor/longman/telegram-bot/src/Entities/Message.php on line 66
MBoretto commented 9 years ago

It will be fixed in the next release

MBoretto commented 9 years ago

Fixed in 0.17