Skip to content

Commit

Permalink
Forgot some things (#35)
Browse files Browse the repository at this point in the history
* Update on_break_end.py

* Update on_break_start.py

* Update on_punishment.py

* Update on_punishment_delete.py

* Update on_shift_edit.py

* Update on_shift_end.py

* Update on_shift_start.py

* Update on_shift_void.py
  • Loading branch information
NoahCxrest authored Jan 10, 2024
1 parent bd9ab7a commit 02fb4ae
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 55 deletions.
12 changes: 6 additions & 6 deletions events/on_break_end.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,17 @@ async def on_break_end(self, object_id: ObjectId):
).add_field(
name="Shift Information",
value=(
f"<:replytop:1138257149705863209> **Staff Member:** {staff_member.mention}\n"
f"<:replybottom:1138257250448855090> **Shift Type:** {shift_type}\n"
f"> **Staff Member:** {staff_member.mention}\n"
f"> **Shift Type:** {shift_type}\n"
),
inline=False
).add_field(
name="Other Information",
value=(
f"<:replytop:1138257149705863209> **Shift Start:** <t:{int(shift.start_epoch)}>\n"
f"<:replymiddle:1138257195121791046> **Ended Break At:** <t:{int(shift.breaks[0].end_epoch)}>\n"
f"<:replymiddle:1138257195121791046> **Total Breaks:** {len(shift.breaks)}\n"
f"<:replybottom:1138257250448855090> **Nickname:** `{shift.nickname}`\n"
f"> **Shift Start:** <t:{int(shift.start_epoch)}>\n"
f"> **Ended Break At:** <t:{int(shift.breaks[0].end_epoch)}>\n"
f"> **Total Breaks:** {len(shift.breaks)}\n"
f"> **Nickname:** `{shift.nickname}`\n"
),
inline=False
).set_author(
Expand Down
12 changes: 6 additions & 6 deletions events/on_break_start.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,17 @@ async def on_break_start(self, object_id: ObjectId):
).add_field(
name="Shift Information",
value=(
f"<:replytop:1138257149705863209> **Staff Member:** {staff_member.mention}\n"
f"<:replybottom:1138257250448855090> **Shift Type:** {shift_type}\n"
f"> **Staff Member:** {staff_member.mention}\n"
f"> **Shift Type:** {shift_type}\n"
),
inline=False
).add_field(
name="Other Information",
value=(
f"<:replytop:1138257149705863209> **Shift Start:** <t:{int(shift.start_epoch)}>\n"
f"<:replymiddle:1138257195121791046> **Started Break At:** <t:{int(shift.breaks[0].start_epoch)}>\n"
f"<:replymiddle:1138257195121791046> **Total Breaks:** {len(shift.breaks)}\n"
f"<:replybottom:1138257250448855090> **Nickname:** `{shift.nickname}`\n"
f"> **Shift Start:** <t:{int(shift.start_epoch)}>\n"
f"> **Started Break At:** <t:{int(shift.breaks[0].start_epoch)}>\n"
f"> **Total Breaks:** {len(shift.breaks)}\n"
f"> **Nickname:** `{shift.nickname}`\n"
),
inline=False
).set_author(
Expand Down
18 changes: 9 additions & 9 deletions events/on_punishment.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,19 @@ async def on_punishment(self, objectid: ObjectId):
).add_field(
name="Moderator Information",
value=(
f"<:replytop:1138257149705863209> **Moderator:** {moderator.mention}\n"
f"<:replymiddle:1138257195121791046> **Warning ID:** `{warning.snowflake}`\n"
f"<:replymiddle:1138257195121791046> **Reason:** {warning.reason}\n"
f"<:replybottom:1138257250448855090> **Moderated At:** <t:{int(warning.time_epoch)}>\n"
f"> **Moderator:** {moderator.mention}\n"
f"> **Warning ID:** `{warning.snowflake}`\n"
f"> **Reason:** {warning.reason}\n"
f"> **Moderated At:** <t:{int(warning.time_epoch)}>\n"
),
inline=False
).add_field(
name="Violator Information",
value=(
f"<:replytop:1138257149705863209> **Username:** {warning.username}\n"
f"<:replymiddle:1138257195121791046> **User ID:** `{warning.user_id}`\n"
f"{'<:replymiddle:1138257195121791046>' if warning.until_epoch not in [None, 0] else '<:replybottom:1138257250448855090>'} **Punishment Type:** {warning.warning_type}\n"
f"{'<:replybottom:1138257250448855090> **Until:** <t:{}>'.format(int(warning.until_epoch)) if warning.until_epoch not in [None, 0] else ''}"
f"> **Username:** {warning.username}\n"
f"> **User ID:** `{warning.user_id}`\n"
f"{'>' if warning.until_epoch not in [None, 0] else '>'} **Punishment Type:** {warning.warning_type}\n"
f"{'> **Until:** <t:{}>'.format(int(warning.until_epoch)) if warning.until_epoch not in [None, 0] else ''}"
),
inline=False
).set_author(
Expand All @@ -96,4 +96,4 @@ async def on_punishment(self, objectid: ObjectId):


async def setup(bot):
await bot.add_cog(OnPunishment(bot))
await bot.add_cog(OnPunishment(bot))
20 changes: 10 additions & 10 deletions events/on_punishment_delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,20 @@ async def on_punishment_delete(self, objectid: ObjectId, manager: discord.Member
).add_field(
name="Moderator Information",
value=(
f"<:replytop:1138257149705863209> **Moderator:** {moderator.mention}\n"
f"<:replymiddle:1138257195121791046> **Revoked By:** {manager.mention}\n"
f"<:replymiddle:1138257195121791046> **Warning ID:** `{warning.snowflake}`\n"
f"<:replymiddle:1138257195121791046> **Reason:** {warning.reason}\n"
f"<:replybottom:1138257250448855090> **Moderated At:** <t:{int(warning.time_epoch)}>\n"
f" **Moderator:** {moderator.mention}\n"
f" **Revoked By:** {manager.mention}\n"
f" **Warning ID:** `{warning.snowflake}`\n"
f" **Reason:** {warning.reason}\n"
f" **Moderated At:** <t:{int(warning.time_epoch)}>\n"
),
inline=False
).add_field(
name="Violator Information",
value=(
f"<:replytop:1138257149705863209> **Username:** {warning.username}\n"
f"<:replymiddle:1138257195121791046> **User ID:** `{warning.user_id}`\n"
f"{'<:replymiddle:1138257195121791046>' if warning.until_epoch not in [None, 0] else '<:replybottom:1138257250448855090>'} **Punishment Type:** {warning.warning_type}\n"
f"{'<:replybottom:1138257250448855090> **Until:** <t:{}>'.format(int(warning.until_epoch)) if warning.until_epoch not in [None, 0] else ''}"
f" **Username:** {warning.username}\n"
f" **User ID:** `{warning.user_id}`\n"
f"{'' if warning.until_epoch not in [None, 0] else ''} **Punishment Type:** {warning.warning_type}\n"
f"{' **Until:** <t:{}>'.format(int(warning.until_epoch)) if warning.until_epoch not in [None, 0] else ''}"
),
inline=False
).set_author(
Expand All @@ -96,4 +96,4 @@ async def on_punishment_delete(self, objectid: ObjectId, manager: discord.Member


async def setup(bot):
await bot.add_cog(OnPunishmentDelete(bot))
await bot.add_cog(OnPunishmentDelete(bot))
12 changes: 6 additions & 6 deletions events/on_shift_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,22 @@ async def on_shift_edit(self, object_id: ObjectId, edited_attribute: typing.Lite
).add_field(
name="Shift Information",
value=(
f"<:replytop:1138257149705863209> **Staff Member:** {staff_member.mention}\n"
f"<:replybottom:1138257250448855090> **Shift Type:** {shift_type}\n"
f"> **Staff Member:** {staff_member.mention}\n"
f"> **Shift Type:** {shift_type}\n"
),
inline=False
).add_field(
name="Other Information",
value=(
f"<:replytop:1138257149705863209> **Shift Start:** <t:{int(shift.start_epoch)}>\n"
f"<:replybottom:1138257250448855090> **Nickname:** `{shift.nickname}`\n"
f"> **Shift Start:** <t:{int(shift.start_epoch)}>\n"
f"> **Nickname:** `{shift.nickname}`\n"
),
inline=False
).add_field(
name="Manager Information",
value=(
f"<:replytop:1138257149705863209> **Edited By:** {editor.mention}\n"
f"<:replybottom:1138257250448855090> **Added Time:** `{shift.added_time}`\n" if edited_attribute == "added_time" else f"<:replybottom:1138257250448855090> **Removed Time:** `{shift.removed_time}`\n"
f"> **Edited By:** {editor.mention}\n"
f"> **Added Time:** `{shift.added_time}`\n" if edited_attribute == "added_time" else f"> **Removed Time:** `{shift.removed_time}`\n"
),
inline=False
).set_author(
Expand Down
12 changes: 6 additions & 6 deletions events/on_shift_end.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,17 @@ async def on_shift_end(self, object_id: ObjectId):
).add_field(
name="Shift Information",
value=(
f"<:replytop:1138257149705863209> **Staff Member:** {staff_member.mention}\n"
f"<:replybottom:1138257250448855090> **Shift Type:** {shift_type}\n"
f"> **Staff Member:** {staff_member.mention}\n"
f"> **Shift Type:** {shift_type}\n"
),
inline=False
).add_field(
name="Other Information",
value=(
f"<:replytop:1138257149705863209> **Shift Start:** <t:{int(shift.start_epoch)}>\n"
f"<:replymiddle:1138257195121791046> **Shift End:** <t:{int(shift.end_epoch)}>\n"
f"<:replymiddle:1138257195121791046> **Shift Length:** {td_format(datetime.timedelta(seconds=shift.end_epoch - shift.start_epoch - (sum((br.end_epoch) - (br.start_epoch) for br in shift.breaks)) + (shift.added_time if shift.added_time > (86400 * 7) else 0) - (shift.removed_time if shift.removed_time > (86400 * 7) else 0)))}\n"
f"<:replybottom:1138257250448855090> **Nickname:** `{shift.nickname}`\n"
f"> **Shift Start:** <t:{int(shift.start_epoch)}>\n"
f"> **Shift End:** <t:{int(shift.end_epoch)}>\n"
f"> **Shift Length:** {td_format(datetime.timedelta(seconds=shift.end_epoch - shift.start_epoch - (sum((br.end_epoch) - (br.start_epoch) for br in shift.breaks)) + (shift.added_time if shift.added_time > (86400 * 7) else 0) - (shift.removed_time if shift.removed_time > (86400 * 7) else 0)))}\n"
f"> **Nickname:** `{shift.nickname}`\n"
),
inline=False
).set_author(
Expand Down
8 changes: 4 additions & 4 deletions events/on_shift_start.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ async def on_shift_start(self, object_id: ObjectId):
).add_field(
name="Shift Information",
value=(
f"<:replytop:1138257149705863209> **Staff Member:** {staff_member.mention}\n"
f"<:replybottom:1138257250448855090> **Shift Type:** {shift_type}\n"
f"> **Staff Member:** {staff_member.mention}\n"
f"> **Shift Type:** {shift_type}\n"
),
inline=False
).add_field(
name="Other Information",
value=(
f"<:replytop:1138257149705863209> **Shift Start:** <t:{int(shift.start_epoch)}>\n"
f"<:replybottom:1138257250448855090> **Nickname:** `{staff_member.nick}`\n"
f"> **Shift Start:** <t:{int(shift.start_epoch)}>\n"
f"> **Nickname:** `{staff_member.nick}`\n"
),
inline=False
).set_author(
Expand Down
16 changes: 8 additions & 8 deletions events/on_shift_void.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,24 +85,24 @@ async def on_shift_void(self, voider: discord.Member, object_id: ObjectId):
).add_field(
name="Shift Information",
value=(
f"<:replytop:1138257149705863209> **Staff Member:** {staff_member.mention}\n"
f"<:replybottom:1138257250448855090> **Shift Type:** {shift_type}\n"
f"> **Staff Member:** {staff_member.mention}\n"
f"> **Shift Type:** {shift_type}\n"
),
inline=False
).add_field(
name="Other Information",
value=(
f"<:replytop:1138257149705863209> **Shift Start:** <t:{int(shift.start_epoch)}>\n"
f"<:replymiddle:1138257195121791046> **Shift End:** <t:{int(shift.end_epoch or datetime.datetime.now(pytz.UTC).timestamp())}>\n"
f"<:replymiddle:1138257195121791046> **Shift Length:** {td_format(datetime.timedelta(seconds=get_elapsed_time(shift)))}\n"
f"<:replybottom:1138257250448855090> **Nickname:** `{shift.nickname}`\n"
f"> **Shift Start:** <t:{int(shift.start_epoch)}>\n"
f"> **Shift End:** <t:{int(shift.end_epoch or datetime.datetime.now(pytz.UTC).timestamp())}>\n"
f"> **Shift Length:** {td_format(datetime.timedelta(seconds=get_elapsed_time(shift)))}\n"
f"> **Nickname:** `{shift.nickname}`\n"
),
inline=False
).add_field(
name="Manager Information",
value=(
f"<:replytop:1138257149705863209> **Voided by:** {voider.mention}\n"
f"<:replybottom:1138257250448855090> **Voided at:** <t:{int(datetime.datetime.now(tz=pytz.UTC).timestamp())}>"
f"> **Voided by:** {voider.mention}\n"
f"> **Voided at:** <t:{int(datetime.datetime.now(tz=pytz.UTC).timestamp())}>"
),
inline=False
).set_author(
Expand Down

0 comments on commit 02fb4ae

Please sign in to comment.