Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for additional messages to be posted in member-services without disruptions #73

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -887,18 +887,21 @@ async def last_week_summary(self):

@run_on_weekday([calendar.MONDAY, calendar.WEDNESDAY], 0, 0)
async def update_report_channel(self):
# member-services messages:
# channel_history[0] --> anonymous report message
# channel_history[1] --> report view message
channel_history = [
m
async for m in self.bot.member_services_channel.history(
limit=1,
oldest_first=True,
limit=2,
)
]
if not channel_history:
return

last_message = channel_history[0]
if last_message.author == self.bot.user:
await last_message.edit(view=ReportsView(self.bot))
reports_message = channel_history[1]
await reports_message.edit(view=ReportsView(self.bot))

@commands.is_owner()
@commands.command()
Expand Down
Loading