stars.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:PyMiki 作者: TheGrammarJew 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号