register_message_handler question #2005
Replies: 9 comments
-
I don't get you. Can you explain what are you trying to achieve in your bot? |
Beta Was this translation helpful? Give feedback.
-
bot sends messageA with a reply to the keyboards "buttonA" and "buttonB". I want the user to delete messageA and send a new messageB when they click on "buttonA". |
Beta Was this translation helpful? Give feedback.
-
Ok, so you are sending a message with 2 buttons and you need to delete the message when one of the buttons is clicked? |
Beta Was this translation helpful? Give feedback.
-
Yes, that's right. |
Beta Was this translation helpful? Give feedback.
-
And what's the issue? |
Beta Was this translation helpful? Give feedback.
-
I use register_message_handler to monitor the button, but the only callback I pass in is the button's message, not the message I want to delete. |
Beta Was this translation helpful? Give feedback.
-
The build button utilises not InlineKeyboardMarkup, but ReplyKeyboardMarkup |
Beta Was this translation helpful? Give feedback.
-
Maybe you are using register_next_step_handler and not message_handler? |
Beta Was this translation helpful? Give feedback.
-
I am trying register_next_step_handler, but can't message_handler be implemented in my scenario? |
Beta Was this translation helpful? Give feedback.
-
Please answer these questions before submitting your issue. Thanks!
latest
debian
3.7
In a normal bot, I use the send_photo method to send a photo to the user with a set of reply keystrokes, called message_a. Afterwards I use the register_message_handler method to monitor bot.register_message_handler( callback = self.start_panel, content_types = ['text'],regexp = "Button_A"). I want to delete message_a when the user clicks on Button_A, but the only parameter passed to register_message_handler is the message for "Button_A". Is it not possible to pass the message of "message_A" into the callback function as well? How can I improve this?
Beta Was this translation helpful? Give feedback.
All reactions