11 |
const AntiRaid = require("./AntiRaid"); |
const AntiRaid = require("./AntiRaid"); |
12 |
const MessageFilter = require("./MessageFilter"); |
const MessageFilter = require("./MessageFilter"); |
13 |
const { random } = require("../commands/pixabay"); |
const { random } = require("../commands/pixabay"); |
14 |
|
const AFKEngine = require("./AFKEngine"); |
15 |
|
|
16 |
class App { |
class App { |
17 |
constructor(rootdir) { |
constructor(rootdir) { |
40 |
this.spamFilter = new SpamFilter(); |
this.spamFilter = new SpamFilter(); |
41 |
this.antiRaid = new AntiRaid(); |
this.antiRaid = new AntiRaid(); |
42 |
this.messageFilter = new MessageFilter(); |
this.messageFilter = new MessageFilter(); |
43 |
|
this.afkEngine = new AFKEngine(); |
44 |
this.boot(); |
this.boot(); |
45 |
} |
} |
46 |
|
|
76 |
} |
} |
77 |
else if (valid && snippet !== undefined) { |
else if (valid && snippet !== undefined) { |
78 |
await message.channel.send({ |
await message.channel.send({ |
79 |
content: snippet.content |
content: snippet.content, |
80 |
|
files: snippet.files.map(f => { |
81 |
|
return { |
82 |
|
attachment: path.resolve(__dirname, '..', 'storage', f) |
83 |
|
} |
84 |
|
}) |
85 |
}); |
}); |
86 |
} |
} |
87 |
else if (valid && !has) { |
else if (valid && !has) { |
90 |
else if (valid && has && !allowed) { |
else if (valid && has && !allowed) { |
91 |
await this.commandManager.notAllowed(); |
await this.commandManager.notAllowed(); |
92 |
} |
} |
93 |
|
else if(!valid) { |
94 |
|
await this.afkEngine.start(message); |
95 |
|
} |
96 |
}); |
}); |
97 |
|
|
98 |
this.on("messageUpdate", async (oldMessage, newMessage) => { |
this.on("messageUpdate", async (oldMessage, newMessage) => { |