7 |
|
|
8 |
load(guild) { |
load(guild) { |
9 |
this.maxJoins = app.config.props[guild.id].raid.max_joins; |
this.maxJoins = app.config.props[guild.id].raid.max_joins; |
10 |
this.included = app.config.props[guild.id].raid.included; |
this.excluded = app.config.props[guild.id].raid.excluded; |
11 |
this.time = app.config.props[guild.id].raid.time; |
this.time = app.config.props[guild.id].raid.time; |
12 |
this.enabled = app.config.props[guild.id].raid.enabled; |
this.enabled = app.config.props[guild.id].raid.enabled; |
13 |
} |
} |
14 |
|
|
15 |
async start(member) { |
async start(member) { |
16 |
|
if (member.user.bot) { |
17 |
|
console.log('bot'); |
18 |
|
return; |
19 |
|
} |
20 |
|
|
21 |
await this.load(member.guild); |
await this.load(member.guild); |
22 |
|
|
23 |
if (!this.enabled) |
if (!this.enabled) |
33 |
this.joins++; |
this.joins++; |
34 |
|
|
35 |
if (this.joins >= this.maxJoins) { |
if (this.joins >= this.maxJoins) { |
36 |
let role = member.guild.roles.cache.find(r => r.id === app.config.props[member.guild.id].gen_role); |
let role = member.guild.roles.everyone; |
37 |
let channels = member.guild.channels.cache.filter(channel => this.included.indexOf(channel.id) !== -1); |
let channels = member.guild.channels.cache.filter(channel => this.excluded.indexOf(channel.id) === -1 && this.excluded.indexOf(channel.parent?.id) === -1 && channel.type === 'GUILD_TEXT'); |
38 |
|
|
39 |
await lockAll(role, channels, true); |
await lockAll(role, channels, true); |
40 |
} |
} |