def on_raw_reaction_clear(self, message_id, channel_id):
channel = self.bot.get_channel(channel_id)
if channel is None or not isinstance(channel, discord.TextChannel):
return
async with self.bot.pool.acquire() as con:
starboard = await self.get_starboard(channel.guild.id, connection=con)
if starboard.channel is None:
return
query = "DELETE FROM starboard_entries WHERE message_id=$1 RETURNING bot_message_id;"
bot_message_id = await con.fetchrow(query, message_id)
if bot_message_id is None:
return
bot_message_id = bot_message_id[0]
msg = await self.get_message(starboard.channel, bot_message_id)
if msg is not None:
await msg.delete()
评论列表
文章目录