예제 #1
0
파일: stores.py 프로젝트: this-guy-dev/myb
 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.")
예제 #2
0
파일: cheats.py 프로젝트: this-guy-dev/myb
 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.')
예제 #3
0
파일: cheats.py 프로젝트: this-guy-dev/myb
 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.')