Add the auto-delete reaction function
All checks were successful
Build and Publish Jimmy.2 / build_and_publish (push) Successful in 8s

This commit is contained in:
Nexus 2024-05-16 19:57:35 +01:00
parent 835d12c226
commit 0a302a6181

View file

@ -372,6 +372,13 @@ class AutoResponder(commands.Cog):
m = await reaction.message.reply(f"[Here's the answer to your question]({url})")
await m.edit(suppress=True)
self.lmgtfy_cache.append(reaction.message.id)
if reaction.emoji.name == "\N{wastebasket}":
if reaction.message.channel.permissions_for(reaction.message.guild.me).manage_messages:
await reaction.message.delete(
reason="%s requested deletion of message" % user,
delay=0.2
)
@commands.Cog.listener("on_raw_reaction_add")
async def on_raw_reaction_add(self, payload: discord.RawReactionActionEvent):