Skip to content

Commit

Permalink
Fix emojis in daily_quest command
Browse files Browse the repository at this point in the history
  • Loading branch information
Iapetus-11 committed Jun 19, 2024
1 parent 6a801ee commit 0e35283
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 7 additions & 2 deletions bot/cogs/commands/econ.py
Original file line number Diff line number Diff line change
Expand Up @@ -2284,6 +2284,11 @@ async def daily_quest(self, ctx: Ctx):
quest = await self.quests.fetch_user_daily_quest(ctx.author.id)

quest_text = ctx.l.econ.daily_quests.mapping[quest.key]
quest_emoji = (
emoji_getter := (
lambda cur, path: emoji_getter(cur[path.pop(0)], path) if path else cur
)
)(self.d.emojis, quest.emoji.split("."))

close_to_completion = (quest.value / (quest.target_value + 0.1)) > 0.75
encouragements = (
Expand All @@ -2302,7 +2307,7 @@ async def daily_quest(self, ctx: Ctx):
title=title_message.format(
quest_title=quest_text.title.format(
target=quest.target_value,
emoji=(emojify_item(self.d, quest.emoji, default=None) or ""),
emoji=quest_emoji,
),
),
description="\n".join([
Expand All @@ -2320,7 +2325,7 @@ async def daily_quest(self, ctx: Ctx):
ctx.l.econ.daily_quests.expires_at.format(
expires_at=discord.utils.format_dt(
quest.day.datetime + datetime.timedelta(days=1),
'R',
"R",
),
),
]),
Expand Down
1 change: 0 additions & 1 deletion bot/cogs/core/quests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import random
import typing
from dataclasses import dataclass
from datetime import datetime

import arrow
import discord
Expand Down

0 comments on commit 0e35283

Please sign in to comment.