Skip to content

Commit

Permalink
Add note about why there is a seemingly superfluous check for whether…
Browse files Browse the repository at this point in the history
… the member is part of the guild (#201)

Co-authored-by: Matt Norton <matt@carrotmanmatt.com>
  • Loading branch information
MattyTheHacker and CarrotManMatt committed May 11, 2024
1 parent 03cc1e5 commit 98c30cb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
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

0 comments on commit 98c30cb

Please sign in to comment.