-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ts
54 lines (40 loc) · 1.44 KB
/
index.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
import { Client } from 'discord.js';
import importFresh from 'import-fresh';
import Bot from './bot';
import sourcemap from 'source-map-support';
// Provide typescript file stack traces
sourcemap.install();
const client = new Client();
let bot = new Bot(client, resetBot);
function resetBot() {
bot = new (importFresh('./bot.js') as typeof Bot)(client, resetBot, true);
}
// const client = new Discord.Client();
// client.once('ready', () => {
// console.log('Ready!');
// });
// function getCommands() {
// const Ping = importFresh('./commands/ping.js') as typeof PingCmd;
// const Reload = importFresh('./commands/reload.js') as typeof ReloadCmd;
// const Test = importFresh('./commands/test.js') as typeof TestCmd;
// const Define = importFresh('./commands/define.js') as typeof DefineCmd;
// return [
// new Ping(),
// new Reload(),
// new Test(),
// new Define(),
// ];
// }
// let cmdHandler = new CommandHandler(getCommands());
// client.on('message', msg => {
// if (msg.channel.name == 'test-channel' || msg.channel.name == 'test') {
// if (msg.content == ';reload') {
// const Handler = importFresh('./command-handler.js') as typeof CommandHandler;
// cmdHandler = new Handler(getCommands());
// msg.channel.send(setMessage('All Commands Reloaded', MessagePriority.MEDIUM));
// return;
// }
// cmdHandler.find(msg);
// }
// });
// client.login(config.apiKeys.discord);