mmpy_bot icon indicating copy to clipboard operation
mmpy_bot copied to clipboard

[Feature Request] Handler for message editions

Open fabien-anabasis opened this issue 2 years ago • 1 comments

Here is a scenario that often happen with my bot:

  • someone writes a message to the bot, but makes an error due to fingers being too large, or something
  • so, the user decides to edit its message, as usual when a typo is made
  • unfortunately, there's no handler for that, and the bot ignores the edition of the previous message

Would it be possible to add a handler for this kind of situations?

fabien-anabasis avatar Sep 29 '23 14:09 fabien-anabasis

It is indeed possible. Currently the bot only intercepts to the "posted" event: image

I theory someone could add the capability to intercept the "post_edited" event. It might be as simple as change the if condition to, assuming of course that the data sent for both events is the same. if event_action in ["posted", "post_edited"]:

You could try it and if it works make a PR.

attzonko avatar Oct 03 '23 03:10 attzonko