api.py 文件源码

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

项目:LunaBot 作者: miraai 项目源码 文件源码
def feeds_delete(self, ctx, *, feed : str):
        """Removes a feed from the channel.

        This will also delete the associated role so this
        action is irreversible.
        """
        channel = ctx.message.channel
        server = channel.server
        feeds = self.feeds.get(channel.id, {})
        feed = feed.lower()
        if feed not in feeds:
            await self.bot.say('This feed does not exist.')
            return

        role = feeds.pop(feed)
        try:
            await self.bot.delete_role(server, discord.Object(id=role))
        except discord.HTTPException:
            await self.bot.say('\U0001F52B')
        else:
            await self.feeds.put(channel.id, feeds)
            await self.bot.say('\U0001F6AE')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号