async def _buy_item(self, ctx, item_id: int = 0, count: int = 0): """Buy an item from the store.""" item_object = Item(item_id) cost = item_object.get_price() * count player = Player(ctx.message.author.id) balance = player.get_balance() wallet = balance['wallet'] if cost > wallet: return await ctx.send("Not enough cash. Need: " + str(cost)) else: player.add_balance('wallet', -cost) player.add_to_inventory(item_id, count) return await ctx.send("Successfully purchased.")
async def _add_bank(self, ctx, money: int = 0): """Add money to bank""" player = Player(ctx.message.author.id) player.add_balance('bank', money) return await ctx.send(str(money) + ' added to bank.')
async def _add_wallet(self, ctx, money: int = 0): """Add money to wallet.""" player = Player(ctx.message.author.id) player.add_balance('wallet', money) return await ctx.send(str(money) + ' added to wallet.')