-
Notifications
You must be signed in to change notification settings - Fork 1
/
alice.js
42 lines (38 loc) · 1.13 KB
/
alice.js
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
//#region import
// 載入env變量
require("dotenv").config();
// Discord
const BDB = require("./baseJS/BaseDiscordBot.js");
// js
const CatchF = require("./baseJS/CatchF.js");
const slashM = require("./slashManager/slashM.js");
const messageM = require("./messageManager/messageM.js");
const buttonM = require("./buttonManager/buttonM.js");
const selectMenuM = require("./selectMenuManager/selectMenuM.js");
//#endregion
//#region Discord宣告
//#region 基本行為
let client;
DoStart();
async function DoStart() {
client = await BDB.Login(process.env.TOKEN);
BDB.On(client, "ready", DiscordReady);
BDB.On(client, "message", messageM.Start);
BDB.On(client, "slash", slashM.Start);
BDB.On(client, "button", buttonM.Start);
BDB.On(client, "selectMenu", selectMenuM.Start);
}
//#endregion
//#region 基本方法
async function DiscordReady() {
// 系統訊息
console.log(`Logged in as ${client.user.tag}!`);
// 註冊協槓命令
CatchF.LogDo("Started refreshing application (/) commands.");
slashM.InsertSlash();
CatchF.LogDo("Successfully reloaded application (/) commands.");
}
//#endregion
//#endregion
//#region 其餘宣告
//#endregion