-
Notifications
You must be signed in to change notification settings - Fork 3
/
kankertron.ts
65 lines (60 loc) · 1.8 KB
/
kankertron.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import 'reflect-metadata';
import { Client } from 'discordx';
import { Intents, Message } from 'discord.js';
import * as dotenv from 'dotenv';
import { Logger } from './plugins/tools';
import { format } from 'date-fns';
dotenv.config({ path: __dirname + '/.env' });
async function start() {
const client = new Client({
prefix: async (message: Message) => {
return '$';
},
classes: [`${__dirname}/commands/*.{js,ts}`],
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MESSAGES,
Intents.FLAGS.GUILD_VOICE_STATES,
Intents.FLAGS.GUILD_EMOJIS_AND_STICKERS,
Intents.FLAGS.DIRECT_MESSAGE_REACTIONS,
Intents.FLAGS.DIRECT_MESSAGES,
Intents.FLAGS.DIRECT_MESSAGE_TYPING,
Intents.FLAGS.GUILD_INTEGRATIONS,
Intents.FLAGS.GUILD_PRESENCES,
Intents.FLAGS.GUILD_WEBHOOKS,
Intents.FLAGS.GUILD_MEMBERS,
Intents.FLAGS.GUILD_INVITES,
Intents.FLAGS.GUILD_BANS,
],
botGuilds: [process.env.GUILD_ID!],
silent: true,
});
try {
client.on('ready', async () => {
console.clear();
Logger.writeLog(
`\r\n${'-'.repeat(10)} K A N K E R T R O N 3 0 0 0 ${'-'.repeat(
10
)}`,
true
);
Logger.writeLog(
`Booted at ${format(new Date(), 'yyyy-MM-dd HH:mm:ss:SSS')}\r\n`,
true
);
Logger.log('Initializing current slash commands...');
await client.initApplicationCommands();
Logger.log('...DONE');
Logger.log('Kankertron is Ready');
});
client.on('interactionCreate', (interaction) => {
client.executeInteraction(interaction);
});
client.login(process.env.CLIENT_TOKEN);
} catch (e) {
Logger.log('Exception', true);
console.error(e);
}
}
start();