Skip to content

Commit

Permalink
Fixing duty manage edit
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikey committed Dec 31, 2023
1 parent 1e2a98a commit 096134d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions cogs/ShiftLogging.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,10 @@ async def duty_manage(self, ctx, *, type: str = "Default"):
)

shift_types = settings.get('shift_types', {}).get('types', [])
msg = None
if shift_types:
if type.lower() not in [t['name'].lower() for t in shift_types]:
await ctx.send(
msg = await ctx.send(
embed=discord.Embed(
title="Incorrect Shift Type",
description="The shift type provided is not valid.",
Expand Down Expand Up @@ -454,7 +455,11 @@ async def duty_manage(self, ctx, *, type: str = "Default"):
starting_container=contained_document
)

view.message = await ctx.send(embed=embed, view=view)
if not msg:
view.message = await ctx.send(embed=embed, view=view)
else:
await msg.edit(embed=embed, view=view)
view.message = msg


@duty.command(
Expand Down
4 changes: 2 additions & 2 deletions events/on_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ async def on_message(self, message: discord.Message):
if mention.top_role > role or mention.top_role == role:
embed = discord.Embed(
title=f"Do not ping {role.name} or above!",
color=discord.Color.red(),
color=BLANK_COLOR,
description=f"Do not ping {role.name} or above!\nIt is a violation of the rules, and you will be punished if you continue.",
)
try:
Expand All @@ -224,7 +224,7 @@ async def on_message(self, message: discord.Message):
embed.set_image(
url="https://i.imgur.com/pXesTnm.gif"
)
except discord.NotFound:
except AttributeError:
pass

embed.set_footer(
Expand Down

0 comments on commit 096134d

Please sign in to comment.