Core: Disable new entries in edited_message table & Read only last command?

Created on 10 Feb 2017  路  4Comments  路  Source: php-telegram-bot/core

Is not an issue, but a question:

  1. Any easy way to disable bot to check edited messages? Maybe a fast way is commenting this line?
    https://github.com/akalongman/php-telegram-bot/blob/518e9dd861f3dafcf6272856043e941bc59fa6dc/src/Telegram.php#L434
    Don't know yet why (maybe because I made little modifications on DB.php and Telegram.php), but when some user edits a command/message, bot crashes https://github.com/akalongman/php-telegram-bot/issues/406 (edited_message DB table shows same edited message 100's times).

  2. Also, how can I read only last message? Sometimes I'm testing new things and editing code, and bot freezes/crash and stop responding to commands.
    After that, when bot is working again, reads & reply to all commands in bulk (last time bot replied to 50+ commands at once). I want to read by default only last command sent by user and execute it.

Thanks!

bug

All 4 comments

  1. Set your webhook with these options:
[
    'allowed_updates' => ['message', 'inline_query', 'chosen_inline_result', 'callback_query', 'channel_post', 'edited_channel_post'] //removed 'edited_message'!
];

(array to be used with commented alternative code in set.php)

  1. I don't think its possible, I suggested to use my cgi workaround because when library fails telegram sees 500 error or receives no reply, he thinks the messages wasnt delivered and will keep trying, using my cgi trick telegram will always get empty successful reply and will not re-send anything, so even if your library fails the bot will not reply to previously failed commands.

Thanks @jacklul! Will try both options, 2nd solution looks a bit complicated for me, hope I don't mess up anything on server.

1st one:
Set.php

Sorry to point it out here again too, but the 500 error must have some other cause.
Internal server error should be addressed properly and fixed 馃槆

Can not reproduce. Looks like fixed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TheSleepySlee picture TheSleepySlee  路  3Comments

Recouse picture Recouse  路  3Comments

abbe-cipher picture abbe-cipher  路  4Comments

NabiKAZ picture NabiKAZ  路  3Comments

esomkin picture esomkin  路  3Comments