/[sudobot]/trunk/src/index.ts
ViewVC logotype

Diff of /trunk/src/index.ts

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

revision 58 by rakin, Mon Jul 29 17:28:25 2024 UTC revision 348 by rakin, Mon Jul 29 17:29:43 2024 UTC
# Line 1  Line 1 
1    import 'reflect-metadata';
2  import { registerCommands, registerEvents } from './utils/registry';  import { registerCommands, registerEvents } from './utils/registry';
3  import DiscordClient from './client/Client';  import DiscordClient from './client/Client';
4  import { Intents } from 'discord.js';  import { Intents } from 'discord.js';
# Line 7  import path from 'path'; Line 8  import path from 'path';
8  import { registrationEnd, registrationStart } from './utils/debug';  import { registrationEnd, registrationStart } from './utils/debug';
9  import { yellow } from './utils/util';  import { yellow } from './utils/util';
10    
 const client = new DiscordClient({  
     partials: ["CHANNEL"],  
     intents: [  
         Intents.FLAGS.GUILDS,  
         Intents.FLAGS.GUILD_MESSAGES,  
         Intents.FLAGS.DIRECT_MESSAGES,  
         Intents.FLAGS.DIRECT_MESSAGE_TYPING,  
         Intents.FLAGS.GUILD_PRESENCES,  
         Intents.FLAGS.GUILD_MEMBERS,  
         Intents.FLAGS.GUILD_BANS,  
         Intents.FLAGS.GUILD_MESSAGE_REACTIONS,  
         Intents.FLAGS.GUILD_EMOJIS_AND_STICKERS,  
     ]  
 }, path.resolve(__dirname, '..'));  
   
11  if (existsSync(path.join(__dirname, '../.env'))) {  if (existsSync(path.join(__dirname, '../.env'))) {
12      config();      config();
13  }  }
# Line 39  if (process.argv.includes('--dev')) { Line 25  if (process.argv.includes('--dev')) {
25      process.env.ENV = 'dev';      process.env.ENV = 'dev';
26  }  }
27    
28    const client = new DiscordClient({
29        partials: ["CHANNEL"],
30        intents: [
31            Intents.FLAGS.GUILDS,
32            Intents.FLAGS.GUILD_MESSAGES,
33            Intents.FLAGS.DIRECT_MESSAGES,
34            Intents.FLAGS.DIRECT_MESSAGE_TYPING,
35            Intents.FLAGS.GUILD_PRESENCES,
36            Intents.FLAGS.GUILD_MEMBERS,
37            Intents.FLAGS.GUILD_BANS,
38            Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
39            Intents.FLAGS.GUILD_EMOJIS_AND_STICKERS,
40        ]
41    }, path.resolve(__dirname, '..'));
42    
43  (async () => {  (async () => {
44      await registrationStart();      await registrationStart();
45      await registerCommands(client, '../commands');      await registerCommands(client, '../commands');
# Line 48  if (process.argv.includes('--dev')) { Line 49  if (process.argv.includes('--dev')) {
49      await registerEvents(client, '../events');      await registerEvents(client, '../events');
50      await registrationEnd();      await registrationEnd();
51            
52      await client.login(process.env.token);      await client.login(process.env.TOKEN);
53        await console.log('test');
54  })();  })();

Legend:
Removed from v.58  
changed lines
  Added in v.348

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26