Question: how to make bot to respond on mention
Closed this issue · 3 comments
Sorry I've been busy recently.
You can do this with a custom implementation of parsePrefix: https://hackage.haskell.org/package/calamity-commands-0.4.0.0/docs/CalamityCommands-ParsePrefix.html#t:ParsePrefix
ParsePrefix has access to the usual effects so you'll be able to use getBotUser to find the bot's id, and then you can remove the prefix: <@{bot id}>
from the message.
In my bot I have a parse prefix implementation that loads prefixes from a database: https://github.com/simmsb/calamity-bot/blob/master/src/CalamityBot/PrefixHandler.hs#L19
Doesn't a Message
include all its mentions
? You could use that with getBotUser
, no?
Doesn't a
Message
include all itsmentions
? You could use that withgetBotUser
, no?
yes will try to add react on channel message, thank you