-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcreateCommands.js
121 lines (111 loc) · 2.67 KB
/
createCommands.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
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
import config from "./config.cjs";
import discord from "discord.js";
const { Client, Intents } = discord;
const client = new Client({
partials: ['MESSAGE', 'CHANNEL', 'REACTION'],
intents: Intents.NON_PRIVILEGED
});
async function main() {
await client.login(config.token);
await client.api.applications(client.user.id).guilds(config.guild).commands.post({data: {
"options": [
{
"type": 3,
"name": "name",
"description": "The `name` (not title) of the package.",
"required": true
},
{
"type": 3,
"name": "manifest",
"description": "The URL of an unlisted manifest JSON file.",
"required": false
}
],
"name": "package",
"description": "Get information about a Foundry VTT package."
}});
console.log("Created /package");
/* await client.api.applications(client.user.id).guilds(config.guild).commands.post({data: {
"options": [
{
"type": 7,
"name": "channel",
"description": "Which channel would you like Leo to send the message?",
"default": false,
"required": true
},
{
"type": 3,
"name": "message",
"description": "What message would you like Leo to send?",
"default": false,
"required": true
}
],
"name": "say",
"description": "Have Leo speak for you."
}});
console.log("Created /say");*/
await client.api.applications(client.user.id).guilds(config.guild).commands.post({data: {
"name": "rep",
"description": "Manage user reputation.",
"options": [
{
"name": "check",
"description": "Check how many reputation a user has.",
"default": true,
"type": 1,
"options": [
{
"type": 6,
"name": "user",
"description": "Who's reputation would you like to check?",
"required": true
}
],
},
{
"name": "give",
"description": "Give another user reputation.",
"type": 1,
"options": [
{
"type": 6,
"name": "user",
"description": "Who would you like to give reputation to?",
"required": true
},
{
"type": 3,
"name": "reason",
"description": `Why are you giving them reputation? Ex "for being so cool"`,
"required": false
},
{
"type": 4,
"name": "amount",
"description": "Moderators only: How much reputation would you like to give?",
"required": false
}
]
},
{
"name": "scoreboard",
"description": "Display the reputation scoreboard.",
"type": 1,
"options": [
{
"type": 4,
"name": "page",
"description": "Which page of the scoreboard would you like to access?",
"required": false
}
],
}
]
}});
console.log("Created /rep");
process.exit();
}
main();