Skip to content

Commit

Permalink
Handle more reward item types
Browse files Browse the repository at this point in the history
  • Loading branch information
Iapetus-11 committed Jun 22, 2024
1 parent 06c20a8 commit d9c5553
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bot/cogs/core/quests.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,13 @@ async def quest_completed(
await self.db.mark_daily_quest_as_done(user_id, quest.key)
quest = await self.fetch_user_daily_quest(user_id)

# TODO: Support more types of rewards (quest.reward_item)
assert quest.reward_item == "emerald"
await self.db.balance_add(user_id, quest.reward_amount)
if quest.reward_amount == "emerald":
await self.db.balance_add(user_id, quest.reward_amount)
elif quest.reward_item == "Barrel":
await self.db.add_item(user_id, "Barrel", 1024, quest.reward_amount)
else:
raise NotImplementedError(f"Couldn't reward item {quest.reward_item} to user {user_id}")

embed = self.get_quest_embed(loc, quest)
view = DailyQuestDoneView(bot=self.bot, loc=loc, user_id=user_id)
Expand Down

0 comments on commit d9c5553

Please sign in to comment.