Skip to content

Commit

Permalink
Prohibit reports from being submitted on Sundays and Mondays.
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrxyz committed Nov 5, 2023
1 parent 3d59825 commit 7c4a2b7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,13 @@ def __init__(self, bot: MILBot):
custom_id="reports_view:submit",
)
async def submit(self, interaction: discord.Interaction, _: discord.ui.Button):
# If button is triggered on Sunday or Monday, send error message
if datetime.datetime.today().weekday() in [6, 0]:
return await interaction.response.send_message(
":x: Weekly reports should be submitted between Tuesday and Saturday. While occasional exceptions can be made if you miss a week—simply inform your team lead—this should not become a regular occurrence. Be aware that the submission window closes promptly at 11:59pm on Saturday.",
ephemeral=True,
)

# Send modal where user fills out report
await interaction.response.send_modal(ReportsModal(self.bot))

Expand Down

0 comments on commit 7c4a2b7

Please sign in to comment.