You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2024-08-09 00:10:00,473 INFO reminders.py:44] Running periodic.
2024-08-09 00:10:06,885 INFO reminders.py:185] Editing reminder -1001xxx/1991.
2024-08-09 00:10:07,641 INFO reminders.py:185] Editing reminder -1001xxx/588813.
2024-08-09 00:10:08,448 INFO reminders.py:185] Editing reminder -1001xxx/103827.
2024-08-09 00:10:09,294 INFO reminders.py:185] Editing reminder -1001xxx/678634.
2024-08-09 00:10:10,017 INFO reminders.py:185] Editing reminder -40xxx/3209.
2024-08-09 00:20:01,642 INFO reminders.py:44] Running periodic.
2024-08-09 00:20:12,006 INFO reminders.py:185] Editing reminder -1001xxx/1991.
2024-08-09 00:20:14,872 ERROR reminders.py:199] While editing 1991 in -1001xxx:
There are a bunch of events coming up:
⋮
Traceback (most recent call last):
File "lib/python3.10/site-packages/metabot/modules/reminders.py", line 188, in reminder_edit
return bot.edit_message_caption(chat_id=groupid,
File "lib/python3.10/site-packages/ntelebot/bot.py", line 71, in __call__
raise ntelebot.errors.Error(data)
ntelebot.errors.Error: {'ok': False, 'error_code': 400, 'description': 'Bad Request: message is not modified: specified new message content and reply markup are exactly the same as a current content and reply markup of the message'}
2024-08-09 00:30:04,334 INFO reminders.py:44] Running periodic.
2024-08-09 00:30:12,429 ERROR loop.py:72] Ignoring uncaught error while dispatching:
Traceback (most recent call last):
File "lib/python3.10/site-packages/ntelebot/loop.py", line 70, in run
callback()
File "lib/python3.10/site-packages/metabot/modules/reminders.py", line 47, in periodic
_daily_messages(multibot, records)
File "lib/python3.10/site-packages/metabot/modules/reminders.py", line 152, in _daily_messages
message = reminder_edit(bot, groupid, last.message['message_id'], newtext,
TypeError: 'NoneType' object is not subscriptable
2024-08-09 00:40:04,992 INFO reminders.py:44] Running periodic.
2024-08-09 00:40:10,887 ERROR loop.py:72] Ignoring uncaught error while dispatching:
Traceback (most recent call last):
File "lib/python3.10/site-packages/ntelebot/loop.py", line 70, in run
callback()
File "lib/python3.10/site-packages/metabot/modules/reminders.py", line 47, in periodic
_daily_messages(multibot, records)
File "lib/python3.10/site-packages/metabot/modules/reminders.py", line 152, in _daily_messages
message = reminder_edit(bot, groupid, last.message['message_id'], newtext,
TypeError: 'NoneType' object is not subscriptable
⋮
2024-08-09 07:00:00,618 INFO reminders.py:44] Running periodic.
2024-08-09 07:00:13,345 INFO reminders.py:161] Sending reminder to -1001xxx.
2024-08-09 07:00:14,305 ERROR loop.py:72] Ignoring uncaught error while dispatching:
Traceback (most recent call last):
File "lib/python3.10/site-packages/ntelebot/loop.py", line 70, in run
callback()
File "lib/python3.10/site-packages/metabot/modules/reminders.py", line 47, in periodic
_daily_messages(multibot, records)
File "lib/python3.10/site-packages/metabot/modules/reminders.py", line 119, in _daily_messages
reminder_edit(bot, groupid, last.message['message_id'], text,
TypeError: 'NoneType' object is not subscriptable
2024-08-09 07:10:03,276 INFO reminders.py:44] Running periodic.
2024-08-09 07:10:09,633 INFO reminders.py:185] Editing reminder -1001xxx/1992.
2024-08-09 07:10:10,412 INFO reminders.py:161] Sending reminder to -1001xxx.
2024-08-09 07:10:14,742 INFO reminders.py:185] Editing reminder -1001xxx/588813.
2024-08-09 07:10:15,620 INFO reminders.py:161] Sending reminder to -1001xxx.
2024-08-09 07:10:16,417 INFO reminders.py:185] Editing reminder -1001xxx/103827.
2024-08-09 07:10:22,358 INFO reminders.py:185] Editing reminder -1001xxx/678634.
If editMessageText/editMessageCaption fails, reminder_edit returns None, which gets written into config/daily.pickle, then all future attempts to dereference last.message['message_id'] will fail.
This used to be prevented by simply checking if message is truthy before updating config/daily.pickle:
…modified).
Send a message to a test chat, modify it, try to modify it with the same text again (verifying ntelebot.errors.Unmodified is raised), then delete it.
See nmlorg/metabot#108.
…as if Telegram returned it as a result of a successful edit.
This is not strictly correct — lastmessage['text'] will not contain the new text (etc.) — but is arguably better than treating an Unmodified as a failure (triggering another attempt to edit next run).
See #108.
Release as 0.3.25.2.
metabot/metabot/modules/reminders.py
Lines 158 to 161 in b37dc23
If
editMessageText
/editMessageCaption
fails,reminder_edit
returnsNone
, which gets written intoconfig/daily.pickle
, then all future attempts to dereferencelast.message['message_id']
will fail.This used to be prevented by simply checking if
message
is truthy before updatingconfig/daily.pickle
:metabot/metabot/modules/reminders.py
Lines 158 to 160 in 72645ad
The text was updated successfully, but these errors were encountered: