Telethon icon indicating copy to clipboard operation
Telethon copied to clipboard

Telegram Topics - Replying in General chat doesn't dork

Open roman2861 opened this issue 3 years ago • 4 comments

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.

roman2861 avatar Dec 10 '22 15:12 roman2861

Could you post the code causing this issue?

Lonami avatar Dec 11 '22 03:12 Lonami

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)

roman2861 avatar Dec 11 '22 10:12 roman2861

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.

Lonami avatar Dec 11 '22 10:12 Lonami

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.

roman2861 avatar Dec 11 '22 11:12 roman2861