Fix add_card quantity bug

This commit is contained in:
Ben 2020-03-26 22:11:59 +00:00
parent 613510f8f7
commit 18d6f7ed32

View File

@ -193,15 +193,15 @@ class Penguin(Spheniscidae, penguin.Penguin):
return True
async def add_card(self, card, quantity=1, member_quantity=0):
async def add_card(self, card, quantity=0, member_quantity=0):
if card.id in self.cards:
penguin_card = self.cards[card.id]
await penguin_card.update(
quantity=penguin_card.quantity + quantity,
member_quantity=member_quantity).apply()
member_quantity=penguin_card.member_quantity + member_quantity).apply()
else:
await self.cards.insert(card_id=card.id)
await self.cards.insert(card_id=card.id, quantity=quantity, member_quantity=member_quantity)
self.logger.info(f'{self.username} added \'{card.name}\' to their ninja deck')