Introduced prefer_emojis for PycordGuild

This commit is contained in:
2025-05-03 00:55:13 +02:00
parent aa2f90e1c5
commit 2d9bf1cfb9
4 changed files with 32 additions and 5 deletions

View File

@@ -43,7 +43,14 @@ class CogConfig(Cog):
),
required=True,
)
@option("channel", description="Text channel for admin notifications", required=True)
@option(
"channel",
description=_("description", "commands", "config_set", "options", "channel"),
description_localizations=in_every_locale(
"description", "commands", "config_set", "options", "channel"
),
required=True,
)
@option(
"timezone",
description=_("description", "commands", "config_set", "options", "timezone"),
@@ -53,12 +60,21 @@ class CogConfig(Cog):
autocomplete=basic_autocomplete(autocomplete_timezones),
required=True,
)
@option(
"prefer_emojis",
description=_("description", "commands", "config_set", "options", "prefer_emojis"),
description_localizations=in_every_locale(
"description", "commands", "config_set", "options", "prefer_emojis"
),
required=True,
)
async def command_config_set(
self,
ctx: ApplicationContext,
category: CategoryChannel,
channel: TextChannel,
timezone: str,
prefer_emojis: bool,
) -> None:
try:
guild: PycordGuild = await self.bot.find_guild(ctx.guild.id)
@@ -79,6 +95,7 @@ class CogConfig(Cog):
channel_id=channel.id,
category_id=category.id,
timezone=str(timezone_parsed),
prefer_emojis=prefer_emojis,
)
await ctx.respond(self.bot._("config_set", "messages", locale=ctx.locale))
@@ -131,6 +148,7 @@ class CogConfig(Cog):
channel_id=guild.channel_id,
category_id=guild.category_id,
timezone=guild.timezone,
prefer_emojis=guild.prefer_emojis,
)
)

View File

@@ -65,9 +65,11 @@ class CogGuess(Cog):
return
if answer.lower() != stage.answer.lower():
# TODO Make a nice message
# await ctx.respond("Provided answer is wrong.")
await ctx.respond(self.bot.config["emojis"]["guess_wrong"])
await ctx.respond(
self.bot.config["emojis"]["guess_wrong"]
if guild.prefer_emojis
else self.bot._("guess_incorrect", "messages", locale=ctx.locale)
)
return
next_stage_index = stage.sequence + 1