coins.py 文件源码

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

项目:jose 作者: lnmds 项目源码 文件源码
def write(self, ctx, person: discord.User, amount: decimal.Decimal):
        """Overwrite someone's wallet.

        This command does not check for incorrect values (like -2 or infinity).
        """
        account = await self.get_account(person.id)
        if account is None:
            raise self.SayException('account not found you dumbass')

        amount = round(amount, 3)

        await self.jcoin_coll.update_one({'id': person.id},
                                         {'$set': {'amount': str(amount)}})
        self.cache_invalidate(person.id)

        await ctx.send(f'Set {self.get_name(account["id"])} to {amount}')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号