1 |
import BaseEvent from '../../utils/structures/BaseEvent'; |
2 |
import DiscordClient from '../../client/Client'; |
3 |
import { GuildMember } from 'discord.js'; |
4 |
import autoRole from '../../services/AutoRole'; |
5 |
|
6 |
export default class GuildMemberAddEvent extends BaseEvent { |
7 |
constructor() { |
8 |
super('guildMemberAdd'); |
9 |
} |
10 |
|
11 |
async run(client: DiscordClient, member: GuildMember) { |
12 |
if (member.user.id === client.user!.id) |
13 |
return; |
14 |
|
15 |
await client.logger.logJoined(member); |
16 |
|
17 |
if (member.user.bot) |
18 |
return; |
19 |
|
20 |
if (await client.antijoin.start(member)) { |
21 |
return; |
22 |
} |
23 |
|
24 |
await client.antiraid.start(member); |
25 |
await autoRole(client, member); |
26 |
|
27 |
await client.welcomer.start(member); |
28 |
|
29 |
if (client.config.props[member.guild.id].verification.enabled) { |
30 |
await client.verification.start(member); |
31 |
} |
32 |
|
33 |
await client.automute.onMemberJoin(member); |
34 |
} |
35 |
} |