Add the auto-delete reaction function
All checks were successful
Build and Publish Jimmy.2 / build_and_publish (push) Successful in 8s
All checks were successful
Build and Publish Jimmy.2 / build_and_publish (push) Successful in 8s
This commit is contained in:
parent
835d12c226
commit
0a302a6181
1 changed files with 7 additions and 0 deletions
|
@ -373,6 +373,13 @@ class AutoResponder(commands.Cog):
|
||||||
await m.edit(suppress=True)
|
await m.edit(suppress=True)
|
||||||
self.lmgtfy_cache.append(reaction.message.id)
|
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")
|
@commands.Cog.listener("on_raw_reaction_add")
|
||||||
async def on_raw_reaction_add(self, payload: discord.RawReactionActionEvent):
|
async def on_raw_reaction_add(self, payload: discord.RawReactionActionEvent):
|
||||||
if discord.utils.get(self.bot.cached_messages, id=payload.message_id):
|
if discord.utils.get(self.bot.cached_messages, id=payload.message_id):
|
||||||
|
|
Loading…
Reference in a new issue