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

Add note about why there is a seemingly superfluous check for whether the member is part of the guild #201

Merged
merged 6 commits into from
May 11, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion cogs/send_get_roles_reminders.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ async def send_get_roles_reminders(self) -> None:
if time_since_role_received <= datetime.timedelta(days=1):
continue

if member not in guild.members:
if member not in guild.members: # HACK: Caching errors can cause the member to no longer be part of the guild at this point, so this check must be performed before sending that member a message # noqa: FIX004
logger.info(
(
"Member with ID: %s does not need to be sent a reminder "
Expand Down
18 changes: 9 additions & 9 deletions cogs/send_introduction_reminders.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,15 @@ async def send_introduction_reminders(self) -> None:
if message_contains_opt_in_out_button:
await message.edit(view=None)

if member not in guild.members:
logger.info(
(
"Member with ID: %s does not need to be sent a reminder "
"because they have left the server."
),
member.id,
)
continue
if member not in guild.members: # HACK: Caching errors can cause the member to no longer be part of the guild at this point, so this check must be performed before sending that member a message # noqa: FIX004
logger.info(
(
"Member with ID: %s does not need to be sent a reminder "
"because they have left the server."
),
member.id,
)
continue

await member.send(
content=(
Expand Down
Loading