LonamiWebs / Telethon

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

Telegram Topics - Replying in General chat doesn't dork #3997

Open roman2861 opened 1 year ago

roman2861 commented 1 year ago

Hello! I see an issue with Topics - if bot replies to the message in General chat, answer goes to the messages mode (in other words, it gets hidden). If I do the same thing in any Topic - reply returns to the same topic as expected.

Lonami commented 1 year ago

Could you post the code causing this issue?

roman2861 commented 1 year ago

Sure.

 @bot.on(events.NewMessage(func=lambda e: e.raw_text.lower() == "/ban"))
 async def ban_command(event: events.ChatAction.Event):
     reply_msg = await event.get_reply_message()
     replied_to_user = reply_msg.sender
     try:
         await bot.edit_permissions(event.chat.id, replied_to_user.id, view_messages=False)
         respond_message = await event.respond('User {{{user}}} was banned', parse_mode="md")
         await event.delete()
     except Exception as e:
         print(e)
Lonami commented 1 year ago

Could you better describe what the error is and what the expected behavior is? I am having a hard time understanding what should be happening instead.

roman2861 commented 1 year ago

https://user-images.githubusercontent.com/944565/206901865-d98d6e45-75e1-49c0-8a12-2ab350e4bba7.mp4

Uploaded a video. If I reply to message in General chat (the only which wasn't created by me, that's default chat) it gets hidden and answer too. It gets unmarked and can be visible only in Messages view.