heist.py 文件源码

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

项目:Jumper-Cogs 作者: Redjumpman 项目源码 文件源码
def _remove_heist(self, ctx, *, target: str):
        """Remove a target from the heist list"""
        author = ctx.message.author
        settings = self.check_server_settings(author.server)
        if string.capwords(target) in settings["Targets"]:
            await self.bot.say("Are you sure you want to remove {} from the list of "
                               "targets?".format(string.capwords(target)))
            response = await self.bot.wait_for_message(timeout=15, author=author)
            if response is None:
                msg = "Canceling removal. You took too long."
            elif response.content.title() == "Yes":
                settings["Targets"].pop(string.capwords(target))
                self.save_system()
                msg = "{} was removed from the list of targets.".format(string.capwords(target))
            else:
                msg = "Canceling target removal."
        else:
            msg = "That target does not exist."
        await self.bot.say(msg)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号