randgame.py 文件源码

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

项目:tmerc-cogs 作者: tmercswims 项目源码 文件源码
def _set(self, ctx: commands.Context, *games: str):
        """Replaces the game list with the given list."""

        games_str = ", ".join(sorted(list(games)))

        await self.bot.reply(cf.question(
            "You are about to replace the current game list with this:{}"
            "Are you sure you want to proceed? (yes/no)".format(
                cf.box(games_str))))

        answer = await self.bot.wait_for_message(timeout=15,
                                                 author=ctx.message.author)

        if answer is None or answer.content.lower().strip() != "yes":
            await self.bot.reply("Game list not replaced.")
            return

        self.settings["del"] += self.settings["games"]

        self.settings["games"] = list(games)
        dataIO.save_json(self.settings_path, self.settings)

        await self.bot.reply(cf.info("Game list replaced."))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号