def reaction_action(self, fmt, emoji, message_id, channel_id, user_id):
if str(emoji) != '\N{WHITE MEDIUM STAR}':
return
channel = self.bot.get_channel(channel_id)
if not isinstance(channel, discord.TextChannel):
return
method = getattr(self, f'{fmt}_message')
user = self.bot.get_user(user_id)
if user is None or user.bot:
return
async with self.bot.pool.acquire() as con:
config = self.bot.get_cog('Config')
if config:
plonked = await config.is_plonked(channel.guild.id, user_id, channel_id=channel_id, connection=con)
if plonked:
return
try:
await method(channel, message_id, user_id, connection=con)
except StarError:
pass
评论列表
文章目录