Open yellowtides opened 3 years ago
Could be useful, however, most bots do not implement this even if it is supported by the module. This is to stop the bot from going back through messages and replying multiple times due to the user fixing a spelling mistake. It's normally safer to just let the user send another command.
Some bots (e.g. MathBot) do track edits, but these often take large inputs (such as entire TeX expressions or the likes). Since the majority of owen's commands are only two words long, I don't think it's (currently) a high priority at all.
Fully agreed @9nine9nine9, as this would also require a messageID -> [replyID]
mapping that Owen could use in order to clean up replies after every message edit. I will change this to low priority.
Current functionality
https://github.com/yellowtides/owenbot-hs/blob/ebbe9937a360b61edfc64185f0d037b36f16eeca/src/EventHandler.hs#L58-L59
As can be seen in the above highlighted lines of code, commands can currently only get triggered by creating a new message.
Reasoning
Message edits are not capable of triggering commands. It would be a nice addition if they would also get processed on message edits, as our
:
prefix makes Discord emoji autocompletion typos quite common.(e.g.
:fortune → 🥠 | :fortune:
)Potential solution
Pattern match on the
MessageUpdate Message
Event data constructor in order to also detect message edits. Further modularise the message creation event handler into its own function, which should be triggered on both event sub-types.E.g.