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
Changes from 1 commit
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
20 changes: 10 additions & 10 deletions cogs/send_introduction_reminders.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,16 @@ async def send_introduction_reminders(self) -> None:
)

if member_needs_reminder:
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

async for message in member.history():
# noinspection PyUnresolvedReferences
message_contains_opt_in_out_button: bool = (
Expand All @@ -135,16 +145,6 @@ 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

await member.send(
content=(
"Hey! It seems like you joined "
Expand Down
Loading