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

Contents of /trunk/src/index.ts

Parent Directory Parent Directory | Revision Log Revision Log


Revision 51 - (show annotations)
Mon Jul 29 17:28:23 2024 UTC (8 months, 1 week ago) by rakin
File MIME type: application/typescript
File size: 990 byte(s)
Release version 2.0
1 import { registerCommands, registerEvents } from './utils/registry';
2 import DiscordClient from './client/Client';
3 import { Intents } from 'discord.js';
4 import { config } from 'dotenv';
5 import { existsSync } from 'fs';
6 import path from 'path';
7
8 const client = new DiscordClient({
9 partials: ["CHANNEL"],
10 intents: [
11 Intents.FLAGS.GUILDS,
12 Intents.FLAGS.GUILD_MESSAGES,
13 Intents.FLAGS.DIRECT_MESSAGES,
14 Intents.FLAGS.DIRECT_MESSAGE_TYPING,
15 Intents.FLAGS.GUILD_PRESENCES,
16 Intents.FLAGS.GUILD_MEMBERS,
17 Intents.FLAGS.GUILD_BANS,
18 Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
19 Intents.FLAGS.GUILD_EMOJIS_AND_STICKERS,
20 ]
21 }, path.resolve(__dirname, '..'));
22
23 if (existsSync(path.join(__dirname, '../.env'))) {
24 config();
25 }
26 else {
27 process.env.ENV = 'prod';
28 }
29
30 (async () => {
31 await registerCommands(client, '../commands');
32 await registerEvents(client, '../events');
33 await client.login(process.env.token);
34 })();

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26