13 |
const { random } = require("../commands/pixabay"); |
const { random } = require("../commands/pixabay"); |
14 |
const AFKEngine = require("./AFKEngine"); |
const AFKEngine = require("./AFKEngine"); |
15 |
const Starboard = require("./Starboard"); |
const Starboard = require("./Starboard"); |
16 |
|
const { runTimeouts, setTimeoutv2 } = require("./setTimeout"); |
17 |
|
const autoRole = require("./AutoRole"); |
18 |
|
|
19 |
class App { |
class App { |
20 |
constructor(rootdir) { |
constructor(rootdir) { |
62 |
this.client.user.setActivity("over the server", { type: "WATCHING" }); |
this.client.user.setActivity("over the server", { type: "WATCHING" }); |
63 |
|
|
64 |
server(); |
server(); |
65 |
|
|
66 |
|
runTimeouts(); |
67 |
|
|
68 |
|
// setTimeoutv2(path.resolve(__dirname, '../queues/send.js'), 10000, "Hello world"); |
69 |
}); |
}); |
70 |
|
|
71 |
this.on('raw', async event => { |
this.on('raw', async event => { |
129 |
}); |
}); |
130 |
|
|
131 |
this.on("messageUpdate", async (oldMessage, newMessage) => { |
this.on("messageUpdate", async (oldMessage, newMessage) => { |
132 |
if (oldMessage.author.bot || oldMessage.content === newMessage.content) |
if (oldMessage.author.bot || !oldMessage.guild || oldMessage.channel.type == 'dm' || oldMessage.content === newMessage.content) |
133 |
return; |
return; |
134 |
|
|
135 |
|
let msg = await this.msg; |
136 |
|
await (this.msg = newMessage); |
137 |
|
|
138 |
|
await this.spamFilter.basic(newMessage); |
139 |
|
await this.messageFilter.start(newMessage, this.commandManager); |
140 |
|
|
141 |
await this.logger.logEdit(oldMessage, newMessage); |
await this.logger.logEdit(oldMessage, newMessage); |
142 |
|
await (this.msg = msg); |
143 |
}); |
}); |
144 |
|
|
145 |
this.on("messageReactionAdd", async (reaction, message) => { |
this.on("messageReactionAdd", async (reaction, message) => { |
146 |
console.log('inside'); |
console.log('inside'); |
147 |
|
|
148 |
if (!reaction || !reaction.message) { |
if (!reaction || !reaction.message || !message.guild || message.channel.type == 'dm') { |
149 |
return; |
return; |
150 |
} |
} |
151 |
|
|
164 |
}); |
}); |
165 |
|
|
166 |
this.on("messageDelete", async (message) => { |
this.on("messageDelete", async (message) => { |
167 |
if (message.author.bot) |
if (message.author.bot || !message.guild || message.channel.type == 'dm') |
168 |
return; |
return; |
169 |
|
|
170 |
await this.logger.logDelete(message); |
await this.logger.logDelete(message); |
189 |
|
|
190 |
this.on('guildMemberAdd', async (member) => { |
this.on('guildMemberAdd', async (member) => { |
191 |
console.log('Joined'); |
console.log('Joined'); |
192 |
|
await autoRole(member, member.guild); |
193 |
await this.antiRaid.start(member); |
await this.antiRaid.start(member); |
194 |
await this.logger.logJoined(member); |
await this.logger.logJoined(member); |
195 |
}); |
}); |