diff --git a/config/JSON/strings.json b/config/JSON/strings.json index 835106b..3d3cc8b 100644 --- a/config/JSON/strings.json +++ b/config/JSON/strings.json @@ -11,6 +11,12 @@ "case_moderator_field_value": "`{0}`", "case_target_field_value": "`{0}` 🎯", "case_reason_field_value": "`{0}`", + "case_guild_no_cases_author": "No Mod Cases", + "case_guild_no_cases": "this server doesn't have any mod cases yet.", + "case_mod_no_cases_author": "No Mod Cases", + "case_mod_no_cases": "this user has not handled any cases in this server.", + "case_guild_cases_author": "All Cases in this Server", + "case_mod_cases_author": "Cases by Moderator ({0})", "daily_already_claimed_author": "Already Claimed", "daily_already_claimed_description": "you can claim your daily reward again .", "daily_already_claimed_footer": "Daily reset is at 7 AM EST", diff --git a/modules/moderation/cases.py b/modules/moderation/cases.py index 6738e70..e2736fe 100644 --- a/modules/moderation/cases.py +++ b/modules/moderation/cases.py @@ -38,12 +38,21 @@ async def view_all_cases_in_guild(ctx, guild_id: int): cases = case_service.fetch_cases_by_guild(guild_id) if not cases: - return await ctx.respond("This server doesn't have any mod cases yet.") + embed = EmbedBuilder.create_error_embed( + ctx, + author_text=CONST.STRINGS["case_guild_no_cases_author"], + description=CONST.STRINGS["case_guild_no_cases"], + ) + return await ctx.respond(embed=embed) pages_list = [] for i in range(0, len(cases), 10): chunk = cases[i : i + 10] - embed = create_case_list_embed(ctx, chunk, "All Cases in this Server") + embed = create_case_list_embed( + ctx, + chunk, + CONST.STRINGS["case_guild_cases_author"], + ) pages_list.append(embed) paginator = pages.Paginator(pages=pages_list) @@ -54,7 +63,12 @@ async def view_all_cases_by_mod(ctx, guild_id: int, moderator: discord.User): cases = case_service.fetch_cases_by_moderator(guild_id, moderator.id) if not cases: - return await ctx.respond("This user has not handled any cases in this server.") + embed = EmbedBuilder.create_error_embed( + ctx, + author_text=CONST.STRINGS["case_mod_no_cases_author"], + description=CONST.STRINGS["case_mod_no_cases"], + ) + return await ctx.respond(embed=embed) pages_list = [] for i in range(0, len(cases), 10): @@ -62,7 +76,7 @@ async def view_all_cases_by_mod(ctx, guild_id: int, moderator: discord.User): embed = create_case_list_embed( ctx, chunk, - f"Cases by Moderator ({moderator.name})", + CONST.STRINGS["case_mod_cases_author"].format(moderator.name), ) pages_list.append(embed)