casino.py 文件源码

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

项目:Jumper-Cogs 作者: Redjumpman 项目源码 文件源码
def _balance_setcasino(self, ctx, user: discord.Member, chips: int):
        """Sets a Casino member's chip balance"""
        author = ctx.message.author
        settings = super().check_server_settings(author.server)
        chip_name = settings["System Config"]["Chip Name"]
        casino_name = settings["System Config"]["Casino Name"]
        try:
            super().set_chips(user, chips)
        except NegativeChips:
            return await self.bot.say(_("Chips must be higher than 0."))
        except UserNotRegistered:
            return await self.bot.say(_("You need to register to the {} Casino. To register type "
                                        "`{}casino join`.").format(casino_name, ctx.prefix))
        else:
            logger.info("SETTINGS CHANGED {}({}) set {}({}) chip balance to "
                        "{}".format(author.name, author.id, user.name, user.id, chips))
            await self.bot.say(_("```Python\nSetting the chip balance of {} to "
                                 "{} {} chips.```").format(user.name, chips, chip_name))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号