events.py 文件源码

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

项目:spirit 作者: jgayfer 项目源码 文件源码
def get_events_channel(self, guild):
        """Return the events channel if it exists, otherwise create one and return it"""
        for channel in guild.channels:
            if channel.name == "upcoming-events":
                return channel

        # Need to make sure the bot can still send messages in the events channel
        overwrites = {
            guild.default_role: discord.PermissionOverwrite(send_messages=False, add_reactions=True),
            guild.me: discord.PermissionOverwrite(send_messages=True, add_reactions=True)
        }
        return await guild.create_text_channel("upcoming-events", overwrites=overwrites)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号