Skip to content

Commit eda37c1

Browse files
💄 updated memberLogs UI
1 parent 7a1c219 commit eda37c1

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

src/helper/memberLogs.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import {
66
} from "discord.js";
77
import { serverLogger } from "../utils/logger";
88
import { updateUserJoinOrLeave } from "../service/user-service";
9+
import { createBasicEmbed } from "../utils/messages";
10+
import { ERRORS, INFO } from "../utils/constants";
911

1012
export function handleMemberJoin(
1113
member: GuildMember,
@@ -16,9 +18,11 @@ export function handleMemberJoin(
1618
(ch: any) => ch.id === process.env.LOGGER_CHANNEL_ID
1719
) as TextChannel;
1820
if (!channel) return;
19-
channel.send(`Welcome to the server, ${member.toString()}`);
21+
channel.send(
22+
createBasicEmbed(INFO.MEMBER_JOIN(member as GuildMember), "SUCCESS")
23+
);
2024
member.send(
21-
`Hello ${member.toString()} ,\nI am Jack, SRMKZILLA's discord assistant.\nWe at SRMKZILLA welcome you to SRMKZILLA - Official Mozilla Campus Club, a lovely community of developers.\nEveryone here has one goal - to learn new and exciting things. \nTo that effect, please do not hesitate to ask any doubts or share an interesting piece of information. If you have any issues with, how things are running, do ping up any **@Moderator** or **@Jack Developer**. We are always here to help you and everyone have a magical experience.\n\nCheckout out ${client?.channels.cache
25+
`Hello ${member.toString()} ,\nI am **Jack**, **SRMKZILLA's discord assistant.**\nWe at SRMKZILLA welcome you to **SRMKZILLA - Official Mozilla Campus Club**, a lovely community of developers.\nEveryone here has one goal - to learn new and exciting things. \nTo that effect, please do not hesitate to ask any doubts or share an interesting piece of information. If you have any issues with, how things are running, do ping up any **@Admin** or **@Jack Developer**. We are always here to help you and everyone have a magical experience.\n\nCheckout out ${client?.channels.cache
2226
.get("793838431277023252")
2327
?.toString()} to get started!\n- Sent from **SRMKZILLA - Official Mozilla Campus Club**`
2428
);
@@ -37,7 +41,9 @@ export function handleMemberLeave(
3741
(ch: any) => ch.id === process.env.LOGGER_CHANNEL_ID
3842
) as TextChannel;
3943
if (!channel) return;
40-
channel.send(`${member.toString()} left the server :(`);
44+
channel.send(
45+
createBasicEmbed(ERRORS.MEMBER_LEAVE(member as GuildMember), "ERROR")
46+
);
4147
updateUserJoinOrLeave(member as GuildMember, "leave");
4248
} catch (err) {
4349
serverLogger("error", "InternalError", err);

src/utils/constants.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { User, MessageEmbed } from "discord.js";
1+
import { User, MessageEmbed, GuildMember } from "discord.js";
22
import { config } from "dotenv";
3-
import { incomingMessageSchema } from "../models/incomingMessage";
43

54
config();
65

@@ -74,13 +73,25 @@ export const ERRORS = {
7473
message:
7574
"Please check your Poll ID, or maybe even your command syntax!\n\n**Help**\nType `#kzjack help` for a list of commands",
7675
},
76+
MEMBER_LEAVE: (member: GuildMember) => {
77+
return {
78+
title: `A member left the server 🥺!`,
79+
message: `<@${member.id}> left the server. Sorry to see you go!`,
80+
};
81+
},
7782
};
7883

7984
export const INFO = {
8085
WAIT: {
8186
title: "Things worth having are worth waiting for! 😉",
8287
message: "Please wait while we fetch a certificate for you! ⏲️",
8388
},
89+
MEMBER_JOIN: (member: GuildMember) => {
90+
return {
91+
title: `A new member joined the server 🥳!`,
92+
message: `<@${member.id}> joined the server! Welcome home!`,
93+
};
94+
},
8495
};
8596

8697
/**

0 commit comments

Comments
 (0)