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))
评论列表
文章目录