Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ea4a6e9

Browse files
committed
Enhance greeting messages
1 parent 4f526ab commit ea4a6e9

File tree

6 files changed

+1660
-398
lines changed

6 files changed

+1660
-398
lines changed

dist/commands/poll.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ function pollCommand(match, message) {
5555
});
5656
}
5757
addEmoji();
58-
// pollOptions.forEach(async (option: string, index: number) => {
59-
// });
6058
}
6159
else {
6260
const yesReaction = yield botMessage.react(constants_1.THUMBS_UP);
@@ -65,14 +63,6 @@ function pollCommand(match, message) {
6563
if (message.deletable) {
6664
message.delete();
6765
}
68-
// Canister.on("messageReactionAdd", async (reaction: MessageReaction, { username }: User) => {
69-
// if (reaction.message.id === botMessage.id) {
70-
// console.log(`${username} has voted! total: ${reaction.count}`);
71-
// }
72-
// });
73-
// setTimeout(() => {
74-
// botMessage.delete();
75-
// }, pollTimeout * 1000);
7666
}
7767
catch (err) {
7868
console.error(err);

dist/main.js

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -15,40 +15,34 @@ Canister.on("ready", () => {
1515
console.log("I am ready!");
1616
});
1717
Canister.on("guildMemberAdd", (newUser) => __awaiter(this, void 0, void 0, function* () {
18-
const channel = yield newUser.createDM();
19-
if (!channel) {
18+
const dmChannel = yield newUser.createDM();
19+
const guildChannel = newUser.guild.channels.find("name", "introductions");
20+
if (!dmChannel || !guildChannel) {
2021
return;
2122
}
22-
let welcomeMessage = `Welcome to Coderplex, <@${newUser.id}>!\n`;
23-
welcomeMessage += "Coderplex is a non-profit organization that is working towards improving the state of tech in Hyderabad,\n";
24-
welcomeMessage += "by building an active and vibrant developer community which provides support, motivation,\n";
25-
welcomeMessage += "confidence and opportunities to all it’s members, so that each of them can progress in their careers\n";
26-
welcomeMessage += "as software developers and engineers.\n";
27-
welcomeMessage += "\n";
28-
welcomeMessage += "Please introduce yourself in #introductions !\n";
29-
welcomeMessage += "Talk about your goals, interests, and views on different technologies out there!\n";
30-
welcomeMessage += "\n";
31-
welcomeMessage += "Ask for help in respective channels! Participate in the community and most of all, learn and have fun!";
32-
welcomeMessage += "\n";
33-
// channel.send(`
34-
// Welcome to Coderplex, <@${newUser.id}>!
35-
// Coderplex is a non-profit organization that is working towards improving the state of tech in Hyderabad,
36-
// by building an active and vibrant developer community which provides support, motivation,
37-
// confidence and opportunities to all it’s members, so that each of them can progress in their careers
38-
// as software developers and engineers.
39-
// Please introduce yourself in #introductions !
40-
// Talk about your goals, interests, and views on different technologies out there!
41-
// Ask for help in respective channels! Participate in the community and most of all, learn and have fun!
42-
// `);
43-
channel.send(welcomeMessage);
44-
console.log(`Welcomed ${newUser.displayName}`);
23+
let dmWelcomeMessage = `Welcome to Coderplex, <@${newUser.id}>!\n`;
24+
dmWelcomeMessage += "Coderplex is a non-profit organization that is working towards improving the state of tech in Hyderabad,\n";
25+
dmWelcomeMessage += "by building an active and vibrant developer community which provides support, motivation,\n";
26+
dmWelcomeMessage += "confidence and opportunities to all it’s members, so that each of them can progress in their careers\n";
27+
dmWelcomeMessage += "as software developers and engineers.\n";
28+
dmWelcomeMessage += "\n";
29+
dmWelcomeMessage += "Please introduce yourself in #introductions !\n";
30+
dmWelcomeMessage += "Talk about your goals, interests, and views on different technologies out there!\n";
31+
dmWelcomeMessage += "\n";
32+
dmWelcomeMessage += "Download the official Discord mobile app at https://discordapp.com/download to stay connected with the community and get notified on latest updates!!";
33+
dmWelcomeMessage += "\n";
34+
dmWelcomeMessage += "Ask for help in respective channels! Participate in the community and most of all, learn and have fun!";
35+
let chWelcomeMessage = `Welcome to Coderplex, <@${newUser.id}>!\n`;
36+
chWelcomeMessage += "Please introduce yourself to the community!";
37+
dmChannel.send(dmWelcomeMessage);
38+
guildChannel.send(chWelcomeMessage);
4539
}));
4640
Canister.on("message", (message) => __awaiter(this, void 0, void 0, function* () {
47-
const pollMatch = message.content.match(/!(poll|help)\s+?(.+)/i); // \s+?(\d)
48-
if (pollMatch && pollMatch.index !== -1) {
49-
switch (pollMatch[1]) {
41+
const commandMatch = message.content.match(/!(poll|help)\s+?(.+)/i); // \s+?(\d)
42+
if (commandMatch && commandMatch.index !== -1) {
43+
switch (commandMatch[1]) {
5044
case "poll":
51-
poll_1.default(pollMatch, message);
45+
poll_1.default(commandMatch, message);
5246
break;
5347
}
5448
}

0 commit comments

Comments
 (0)