/[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 22 by rakin, Mon Jul 29 17:28:15 2024 UTC revision 25 by rakin, Mon Jul 29 17:28:16 2024 UTC
# Line 10  const SpamFilter = require("./SpamFilter Line 10  const SpamFilter = require("./SpamFilter
10  const server = require("./server");  const server = require("./server");
11  const AntiRaid = require("./AntiRaid");  const AntiRaid = require("./AntiRaid");
12  const MessageFilter = require("./MessageFilter");  const MessageFilter = require("./MessageFilter");
13    const { random } = require("../commands/pixabay");
14    
15  class App {  class App {
16      constructor(rootdir) {      constructor(rootdir) {
# Line 27  class App { Line 28  class App {
28                  Intents.FLAGS.DIRECT_MESSAGE_TYPING,                  Intents.FLAGS.DIRECT_MESSAGE_TYPING,
29                  Intents.FLAGS.GUILD_PRESENCES,                  Intents.FLAGS.GUILD_PRESENCES,
30                  Intents.FLAGS.GUILD_MEMBERS,                  Intents.FLAGS.GUILD_MEMBERS,
31                    Intents.FLAGS.GUILD_BANS
32              ]              ]
33          });          });
34    
# Line 43  class App { Line 45  class App {
45      boot() {      boot() {
46          this.on('ready', () => {          this.on('ready', () => {
47              console.log("Logged in as " + this.client.user.tag);              console.log("Logged in as " + this.client.user.tag);
48    
49                this.client.user.setStatus(random(['dnd', 'idle']));
50                this.client.user.setActivity("over the server", { type: "WATCHING" });
51    
52              server();              server();
53          });          });
54    
# Line 80  class App { Line 86  class App {
86          });          });
87    
88          this.on("messageUpdate", async (oldMessage, newMessage) => {          this.on("messageUpdate", async (oldMessage, newMessage) => {
89              if (oldMessage.author.bot)              if (oldMessage.author.bot || oldMessage.content === newMessage.content)
90                  return;                  return;
91    
92              await this.logger.logEdit(oldMessage, newMessage);              await this.logger.logEdit(oldMessage, newMessage);
93          });          });
94    
95    
96            this.on('guildBanAdd', async (ban) => {
97                console.log('test');
98                await this.logger.logBanned(ban);
99            });
100    
101            this.on('guildBanRemove', async (ban) => {
102                console.log('test');
103                await this.logger.logUnbanned(ban);
104            });
105    
106          this.on("messageDelete", async (message) => {          this.on("messageDelete", async (message) => {
107              if (message.author.bot)              if (message.author.bot)
108                  return;                  return;
# Line 113  class App { Line 130  class App {
130          this.on('guildMemberAdd', async (member) => {          this.on('guildMemberAdd', async (member) => {
131              console.log('Joined');              console.log('Joined');
132              await this.antiRaid.start(member);              await this.antiRaid.start(member);
133                await this.logger.logJoined(member);
134            });
135    
136            this.on('guildMemberRemove', async (member) => {
137                await this.logger.logLeft(member);
138          });          });
139      }      }
140    

Legend:
Removed from v.22  
changed lines
  Added in v.25

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26