Skip to content

Commit

Permalink
warnsystem: fix display and case edition index
Browse files Browse the repository at this point in the history
  • Loading branch information
laggron42 committed Oct 31, 2023
1 parent 2981699 commit 111e0e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions warnsystem/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,14 @@ async def edit_button(self, interaction: discord.Interaction, button: Button):
interaction = modal.interaction
embed = discord.Embed()
new_reason = await self.api.format_reason(interaction.guild, modal.new_reason.value)
embed.description = _("Case #{number} edition.").format(number=self.case_index)
embed.description = _("Case #{number} edition.").format(number=self.case_index + 1)
embed.add_field(name=_("Old reason"), value=self.case["reason"], inline=False)
embed.add_field(name=_("New reason"), value=new_reason, inline=False)
embed.set_footer(text=_("Click on ✅ to confirm the changes."))
response = await prompt_yes_or_no(self.bot, interaction, embed=embed, clear_after=False)
if response is False:
return
await self.api.edit_case(interaction.guild, self.user, self.case_index, new_reason)
await self.api.edit_case(interaction.guild, self.user, self.case_index + 1, new_reason)
await interaction.followup.edit_message(
"@original", content=_("The reason was successfully edited!\n"), embed=None, view=None
)
Expand All @@ -227,7 +227,7 @@ async def delete_button(self, interaction: discord.Interaction, button: Button):
add_roles = await self.ws.data.guild(guild).remove_roles()
description = _(
"Case #{number} deletion.\n**Click on the button to confirm your action.**"
).format(number=self.case_index)
).format(number=self.case_index + 1)
if can_unmute or add_roles:
description += _("\nNote: Deleting the case will also do the following:")
if can_unmute:
Expand Down
2 changes: 1 addition & 1 deletion warnsystem/warnsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def __init__(self, bot: "Red"):

self.task: asyncio.Task

__version__ = "1.5.3"
__version__ = "1.5.4"
__author__ = ["retke (El Laggron)"]

# helpers
Expand Down

0 comments on commit 111e0e2

Please sign in to comment.