/[sudobot]/trunk/src/App.js
ViewVC logotype

Diff of /trunk/src/App.js

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 33 by rakin, Mon Jul 29 17:28:17 2024 UTC revision 49 by rakin, Mon Jul 29 17:28:21 2024 UTC
# Line 13  const MessageFilter = require("./Message Line 13  const MessageFilter = require("./Message
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) {
# Line 60  class App { Line 62  class App {
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 => {
# Line 123  class App { Line 129  class App {
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                            
# Line 151  class App { Line 164  class App {
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);
# Line 176  class App { Line 189  class App {
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          });          });

Legend:
Removed from v.33  
changed lines
  Added in v.49

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26