Added i18n to the jailing mechanism

This commit is contained in:
2025-04-29 16:47:15 +02:00
parent 137ecffcf7
commit 390145ca0e
6 changed files with 31 additions and 23 deletions

View File

@@ -90,15 +90,20 @@ class CogUser(Cog):
pycord_user: PycordUser = await self.bot.find_user(user, ctx.guild)
if pycord_user.is_jailed:
# TODO Introduce i18n
await ctx.respond(f"User **{user.display_name}** is already jailed.")
await ctx.respond(
self.bot._("user_jail_already_jailed", "messages", locale=ctx.locale).format(
display_name=user.display_name
),
ephemeral=True,
)
return
await pycord_user.jail(self.bot.cache)
# TODO Introduce i18n
await ctx.respond(
f"User **{user.display_name}** has been jailed and cannot interact with events anymore."
self.bot._("user_jail_successful", "messages", locale=ctx.locale).format(
display_name=user.display_name
)
)
@command_group.command(
@@ -128,15 +133,20 @@ class CogUser(Cog):
pycord_user: PycordUser = await self.bot.find_user(user, ctx.guild)
if not pycord_user.is_jailed:
# TODO Introduce i18n
await ctx.respond(f"User **{user.display_name}** is not jailed.")
await ctx.respond(
self.bot._("user_unjail_not_jailed", "messages", locale=ctx.locale).format(
display_name=user.display_name
),
ephemeral=True,
)
return
await pycord_user.unjail(self.bot.cache)
# TODO Introduce i18n
await ctx.respond(
f"User **{user.display_name}** has been unjailed and can interact with events again."
self.bot._("user_unjail_successful", "messages", locale=ctx.locale).format(
display_name=user.display_name
)
)