mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-19 18:16:34 +01:00
I hate emoji comparisons
This commit is contained in:
parent
461fb58364
commit
db7d6ea714
1 changed files with 3 additions and 8 deletions
|
@ -17,18 +17,13 @@ class Events(commands.Cog):
|
||||||
@commands.Cog.listener()
|
@commands.Cog.listener()
|
||||||
async def on_raw_reaction_add(self, payload: discord.RawReactionActionEvent):
|
async def on_raw_reaction_add(self, payload: discord.RawReactionActionEvent):
|
||||||
channel: Optional[discord.TextChannel] = self.bot.get_channel(payload.channel_id)
|
channel: Optional[discord.TextChannel] = self.bot.get_channel(payload.channel_id)
|
||||||
if channel:
|
if channel is not None:
|
||||||
try:
|
try:
|
||||||
message: discord.Message = await channel.fetch_message(payload.message_id)
|
message: discord.Message = await channel.fetch_message(payload.message_id)
|
||||||
except discord.HTTPException:
|
except discord.HTTPException:
|
||||||
return
|
return
|
||||||
if message.author == self.bot.user:
|
if message.author == self.bot.user:
|
||||||
if str(payload.emoji) == "\N{WASTEBASKET}":
|
if payload.emoji == discord.PartialEmoji.from_str("\N{wastebasket}"):
|
||||||
try:
|
|
||||||
await message.edit(content=f"[deleted by <@{payload.user_id}>]", embed=None, view=None)
|
|
||||||
except discord.HTTPException:
|
|
||||||
pass
|
|
||||||
finally:
|
|
||||||
await message.delete(delay=1)
|
await message.delete(delay=1)
|
||||||
|
|
||||||
@commands.Cog.listener()
|
@commands.Cog.listener()
|
||||||
|
|
Loading…
Reference in a new issue