-2

I want to remove/hide reply keyboard from a message I try:

await event.edit(buttons=[])

but it doesn't work

yaschk
  • 320
  • 1
  • 11

2 Answers2

1

You can not edit events, because at normally they are incoming not outgoing.

for remove reply_markup/reply_keyboard you should send a message and put buttons value empty :

await client.send_message(event.chat_id,'Some Text',buttons=None)

but if you have the message id of previous message you sent you can edit that message buttons:

await client.edit_message(chat_id,message_id,'New Text',buttons=None)
Purya
  • 123
  • 7
1

buttons=None didn't work for me, buttons=Button.clear(), however, did:

await event.respond("Text", buttons=Button.clear())
RJ Adriaansen
  • 9,131
  • 2
  • 12
  • 26