-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcommandreg.js
More file actions
132 lines (129 loc) · 2.73 KB
/
commandreg.js
File metadata and controls
132 lines (129 loc) · 2.73 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
const { REST } = require("@discordjs/rest");
const { Routes } = require("discord-api-types/v9");
require("dotenv").config();
const commands = [
{
name: "ping",
description: "看看機器人有沒有活著?",
},
{
name: "help",
description: "不會用指令? 使用 /help 來查看指令列表吧!",
},
{
name: "freecoin",
description: "查看你的 FreeCoin 數量",
},
{
name: "transfer",
description: "轉移 FreeCoin 給其他使用者,會收取 5% 手續費",
options: [
{
name: "使用者",
description: "要轉移 FreeCoin 的使用者",
type: 6,
required: true,
},
{
name: "數量",
description: "要轉移的 FreeCoin 數量",
type: 4,
required: true,
},
],
},
{
name: "feecalculate",
description: "計算轉移 FreeCoin 的手續費",
options: [
{
name: "數量",
description: "要轉移的 FreeCoin 數量",
type: 4,
required: true,
},
],
},
{
name: "fbooster",
description: "管理你的 FBooster。這是什麼? 查看 /help 來了解更多",
options: [
{
name: "動作",
description: "選擇動作",
type: 3,
required: true,
choices: [
{
name: "查看",
value: "view",
},
{
name: "購買",
value: "buy",
},
{
name: "使用",
value: "use",
},
],
},
],
},
{
name: "sign",
description: "每日簽到,可獲得隨機 FreeCoin",
},
{
name: "question",
description: "提供 FreeCoin,使其他人回答問題;問題將被發至聊天室",
options: [
{
name: "數量",
description: "要提供的 FreeCoin 獎勵數量",
min_value: 15,
type: 4,
required: true,
},
{
name: "問題",
description: "要提供的問題",
type: 3,
required: true,
},
{
name: "正確解答",
description:
'問題的正確解答,可以提供多項,使用半形逗號","分開答案。(注意:空格也會被視為答案內容)',
type: 3,
required: true,
},
],
},
{
name: "multiplier",
description: "查看目前 FBooster 的倍率、到期時間與使用者",
},
{
name: "togglemention",
description: "在機器人更新你的 FreeCoin 時,是否要提及你",
},
{
name: "level",
description: "查看你的等級",
},
];
const CLIENT_ID = process.env.CLIENT_ID;
const GUILD_ID = process.env.GUILD_ID;
const rest = new REST({ version: "9" }).setToken(process.env.DISCORD_TOKEN);
(async () => {
try {
console.log("Started refreshing application (/) commands.");
await rest.put(Routes.applicationGuildCommands(CLIENT_ID, GUILD_ID), {
body: commands,
});
console.log("Successfully reloaded application (/) commands.");
} catch (error) {
console.error(error);
}
})();