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 |
|
|
18 |
class App { |
class App { |
19 |
constructor(rootdir) { |
constructor(rootdir) { |
61 |
this.client.user.setActivity("over the server", { type: "WATCHING" }); |
this.client.user.setActivity("over the server", { type: "WATCHING" }); |
62 |
|
|
63 |
server(); |
server(); |
64 |
|
|
65 |
|
runTimeouts(); |
66 |
|
|
67 |
|
// setTimeoutv2(path.resolve(__dirname, '../queues/send.js'), 10000, "Hello world"); |
68 |
}); |
}); |
69 |
|
|
70 |
this.on('raw', async event => { |
this.on('raw', async event => { |
128 |
}); |
}); |
129 |
|
|
130 |
this.on("messageUpdate", async (oldMessage, newMessage) => { |
this.on("messageUpdate", async (oldMessage, newMessage) => { |
131 |
if (oldMessage.author.bot || oldMessage.content === newMessage.content) |
if (oldMessage.author.bot || !oldMessage.guild || oldMessage.channel.type == 'dm' || oldMessage.content === newMessage.content) |
132 |
return; |
return; |
133 |
|
|
134 |
|
let msg = await this.msg; |
135 |
|
await (this.msg = newMessage); |
136 |
|
|
137 |
|
await this.spamFilter.basic(newMessage); |
138 |
|
await this.messageFilter.start(newMessage, this.commandManager); |
139 |
|
|
140 |
await this.logger.logEdit(oldMessage, newMessage); |
await this.logger.logEdit(oldMessage, newMessage); |
141 |
|
await (this.msg = msg); |
142 |
}); |
}); |
143 |
|
|
144 |
this.on("messageReactionAdd", async (reaction, message) => { |
this.on("messageReactionAdd", async (reaction, message) => { |
145 |
console.log('inside'); |
console.log('inside'); |
146 |
|
|
147 |
if (!reaction || !reaction.message) { |
if (!reaction || !reaction.message || !message.guild || message.channel.type == 'dm') { |
148 |
return; |
return; |
149 |
} |
} |
150 |
|
|
163 |
}); |
}); |
164 |
|
|
165 |
this.on("messageDelete", async (message) => { |
this.on("messageDelete", async (message) => { |
166 |
if (message.author.bot) |
if (message.author.bot || !message.guild || message.channel.type == 'dm') |
167 |
return; |
return; |
168 |
|
|
169 |
await this.logger.logDelete(message); |
await this.logger.logDelete(message); |