I expected, that this function will only be fired once per received new message. So, if the inputCmdChannel has already messages in it and I start the python program, nothing should happen until I send a new message.
Actual behavior
Currently NewMessageListener sometime is fired multiple times and process one or two older messages that are allready in the inputCmdChannel.
Traceback
No response
Telethon version
36.0
Python version
3.10.12
Operating system (including distribution name and version)
Debian 12.2
Other details
No response
Checklist
[x] The error is in the library's code, and not in my own.
[X] I have searched for this issue before posting it and there isn't an open duplicate.
[X] I ran pip install -U https://github.com/LonamiWebs/Telethon/archive/v1.zip and triggered the bug in the latest version.
Have a similar issue where same new message is being sent a number of times and then today I just got a flood of messages that were months old. Will add a max id check by channel to try to deal with it.
Code that causes the issue
´´'from telethon import TelegramClient, events, sync
api_id = "yyyyy" api_hash = "xxxxxxx" client = TelegramClient('me', api_id, api_hash) clientCommander = TelegramClient('commander', api_id, api_hash)
@client.on(events.NewMessage(chats = inputCmdChannel)) async def NewMessageListener(event): msg = event.message.message
´´´
Expected behavior
I expected, that this function will only be fired once per received new message. So, if the inputCmdChannel has already messages in it and I start the python program, nothing should happen until I send a new message.
Actual behavior
Currently NewMessageListener sometime is fired multiple times and process one or two older messages that are allready in the inputCmdChannel.
Traceback
No response
Telethon version
36.0
Python version
3.10.12
Operating system (including distribution name and version)
Debian 12.2
Other details
No response
Checklist
pip install -U https://github.com/LonamiWebs/Telethon/archive/v1.zip
and triggered the bug in the latest version.