Skip to content

Commit

Permalink
fix: get username and not id
Browse files Browse the repository at this point in the history
  • Loading branch information
juddisjudd committed Jun 3, 2024
1 parent 3053c4c commit 0f02230
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/events/onMemberJoin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const onMemberJoin = async (member: GuildMember) => {
const channel = member.guild.channels.cache.get(member_activity_channel) as TextChannel;
if (!channel) return;

const welcomeMessage = `Welcome ${member.id} to the server!`;
const welcomeMessage = `Welcome ${member.user.username} to the server!`;
channel.send(welcomeMessage);

const roleId = '842455998266605610'; // Overextended Member RoleID
Expand Down
4 changes: 2 additions & 2 deletions src/events/onMemberLeave.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const onMemberLeave = async (member: GuildMember | PartialGuildMember) =>
try {
member = await member.fetch();
} catch {
await channel.send(`error fetching partial member ${member.id}`);
await channel.send(`error fetching partial member ${member.user.username}`);
return;
}
}
Expand All @@ -33,6 +33,6 @@ export const onMemberLeave = async (member: GuildMember | PartialGuildMember) =>
? `${hours} hours and ${minutes} minutes`
: `${minutes} minutes`;

const farewellMessage = `${member.id} has left the server. They were here for ${durationMessage}.`;
const farewellMessage = `${member.user.username} has left the server. They were here for ${durationMessage}.`;
channel.send(farewellMessage);
};

0 comments on commit 0f02230

Please sign in to comment.