-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
36 lines (24 loc) · 900 Bytes
/
index.js
File metadata and controls
36 lines (24 loc) · 900 Bytes
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
// requirement
const fs = require('fs');
const structure = require("./structures/client.js");
const {Token, App_Id, App_Secret} = process.env; // make sure fulfill .env file
const guildId = "322044049991401474"; // let it blank, deploy command as global command
// client registration
const client = new structure(Token, App_Id, App_Secret, guildId);
// load command assets
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
commandFiles.map(e => {
const command = require(`./commands/${e}`);
const command_name = command.data.name;
client.commandManager.addCommand(command_name, command);
console.log(`registering ${e} as ${command_name}`);
});
// register command
client.commandManager.submit();
(async ()=>{
// do trial thing
})()
// Handler registration
require("./handler")(client);
// start webserver
require("./webserver")(client);