LonamiWebs / Telethon

Pure Python 3 MTProto API Telegram client library, for bots too!
https://docs.telethon.dev
MIT License
9.64k stars 1.38k forks source link

events.Raw(UpdateBotInlineSend) works after 1 #4393

Open johnwallet opened 2 months ago

johnwallet commented 2 months ago

Code that causes the issue

@bot.on(events.Raw(UpdateBotInlineSend))
async def inlinequery_callback(event):
    await bot(EditInlineBotMessageRequest(
        id=event.msg_id,
        message='text',
        no_webpage=True,
        media=None,
        reply_markup=None,
        entities=None
    ))

Expected behavior

It should work every time.

Actual behavior

It works after 1 time. 1 - works, 2 - does not work, 3 - works, and so on.. It turns out to receive an event every time the session closes.

Traceback

No response

Telethon version

1.36.0

Python version

3.12.2

Operating system (including distribution name and version)

Windows 10

Other details

No response

Checklist

johnwallet commented 2 months ago

Will there be any comments here?

Lonami commented 2 months ago

I have not had the time or urgency to look into this. If it's important to you, feel welcome to investigate and send a PR.

Though I'm fairly sure this update is special and configured in BotFather. It does not have pts or qts like the rest. Meaning, if Telegram doesn't send it, Telethon can't recover or fetch it.