Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

added "joined at" to member leave notifications #217

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
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
7 changes: 6 additions & 1 deletion moderation/logging/cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,12 @@ async def on_member_remove(self, member: Member):
if (log_channel := await self.get_logging_channel(LoggingSettings.member_leave_channel)) is None:
return

await log_channel.send(t.member_left_server(member))
if join := member.joined_at:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if join := member.joined_at:
if joinDate := member.joined_at:

await log_channel.send(
t.member_left_server_with_joined(member, member.id, join.strftime("%m/%d/%Y, %H:%M:%S"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
t.member_left_server_with_joined(member, member.id, join.strftime("%m/%d/%Y, %H:%M:%S"))
t.member_left_server_with_joined(member, member.id, joinDate.strftime("%m/%d/%Y, %H:%M:%S"))

)
else:
await log_channel.send(t.member_left_server(member, member.id))

@commands.group(aliases=["log"])
@LoggingPermission.read.check
Expand Down
3 changes: 2 additions & 1 deletion moderation/logging/translations/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ message_id: Message ID
created_at: Created At

member_joined_server: "{} ({}) just joined the server!"
member_left_server: "**{}** just left the server!"
member_left_server_with_joined: "**{}** ({}) just left the server! Latest join was at {}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
member_left_server_with_joined: "**{}** ({}) just left the server! Latest join was at {}"
member_left_server_with_joined: "**{}** ({}) just left the server! The most recent join occurred at {}."

Or even better: "The most recent join occurred on 02/24/2023 at 15:00:00."
This template makes use of the correct prepositions.

member_left_server: "**{}** ({}) just left the server!"

log_not_changed_no_permissions: >
Logging channel could not be changed because I don't have `send_messages` permission there.
Expand Down