-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodule.ts
More file actions
21 lines (19 loc) · 802 Bytes
/
module.ts
File metadata and controls
21 lines (19 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import * as config from '../config';
discord.on(discord.Event.GUILD_MEMBER_ADD, async (member) => {
var channel = await discord.getGuildTextChannel(config.joinleave.channel);
if (!channel)
return console.log(
"[JOINLEAVE] You set an incorrect channel ID in your configuration. Please ensure it's valid."
);
channel.sendMessage(`<@${member.user.id}>\n${config.joinleave.joinmessage}`);
});
discord.on(discord.Event.GUILD_MEMBER_REMOVE, async (member) => {
var channel = await discord.getGuildTextChannel(config.joinleave.channel);
if (!channel)
return console.log(
"[JOINLEAVE] You set an incorrect channel ID in your configuration. Please ensure it's valid."
);
channel.sendMessage(
`**${member.user.username}**\n${config.joinleave.leavemessage}`
);
});