communications.py 文件源码

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

项目:Asurix-bot 作者: Beafantles 项目源码 文件源码
def check_reactions_clear(self, message, reactions):
        """Checks for reactions clears"""
        #pylint: disable=unused-argument
        #pylint: disable=too-many-nested-blocks
        if message.author.id not in self.bot.blacklist:
            for com in self.communications:
                for msg in self.communications[com].messages:
                    if msg["id"] == message.id:
                        msg["reactions"] = {}

                        index = -1
                        for i in range(0, len(msg["embed"].fields)):
                            if msg["embed"].fields[i].name == "Reactions":
                                index = i
                                break

                        if index != -1:
                            msg["embed"].remove_field(index)

                        for message_sent in msg["messages"]:
                            try:
                                await self.bot.edit_message(message_sent, embed=msg["embed"])
                            except discord.HTTPException:
                                pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号