-
Notifications
You must be signed in to change notification settings - Fork 1
/
deploy.js
181 lines (175 loc) · 4.86 KB
/
deploy.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
const { REST } = require('@discordjs/rest');
const { Routes } = require('discord-api-types/v9');
const { discordClientId, discordGuildId, discordToken } = require('./config.json');
const commands = [
{
name: 'shock',
description: 'Activate the shock with a specified intensity and duration (optional: user)',
options: [{
name: 'intensity',
type: 4,
description: 'The intensity of the shock (1-100)',
required: true,
}, {
name: 'duration',
type: 4,
description: 'The duration of the shock (1-15)',
required: true,
}, {
name: 'user',
type: 3,
description: 'The user to shock (optional)',
required: false,
}],
},
{
name: 'vibrate',
description: 'Activate vibration with a specified intensity',
options: [{
name: 'intensity',
type: 4,
description: 'The intensity of the vibration (1-100)',
required: true,
}, {
name: 'duration',
type: 4,
description: 'The duration of the vibration (1-15)',
required: true,
}, {
name: 'user',
type: 3,
description: 'The user to vibrate (optional)',
required: false,
}],
},
{
name: 'beep',
description: 'Activate a beep sound',
options: [{
name: 'duration',
type: 4,
description: 'The duration of the beep (1-15)',
required: true,
}, {
name: 'user',
type: 3,
description: 'The user to shock (optional)',
required: false,
}],
},
{
name: 'add',
description: 'Add your PiShock User',
options: [{
name: 'sharecode',
type: 3,
description: 'The share code of the PiShock User',
required: true,
}]
},
{
name: 'remove',
description: 'Remove your PiShock User'
},
{
name: 'adminadd',
description: 'Add a new PiShock User',
options: [{
name: 'username',
type: 3,
description: 'The username of the PiShock User',
required: true,
}, {
name: 'sharecode',
type: 3,
description: 'The share code of the PiShock User',
required: true,
}]
},
{
name: 'adminremove',
description: 'Remove a new PiShock User',
options: [{
name: 'username',
type: 3,
description: 'The username of the PiShock User',
required: true,
}]
},
{
name: 'shockban',
description: '(Admin) Ban a user from using the shock',
options: [{
name: 'username',
type: 6,
description: 'The username of the PiShock User',
required: true,
}]
},
{
name: 'shockunban',
description: '(Admin) Unban a user from using the shock',
options: [{
name: 'username',
type: 6,
description: 'The username of the PiShock User',
required: true,
}]
},
{
name: 'debug',
description: 'Debug the PiShock device',
options: [{
name: 'user',
type: 3,
description: 'The user to debug',
required: true,
}]
},
{
name: 'stats',
description: 'Get stats about the top 10 users',
},
{
name: 'list',
description: 'List all of the known PiShock Users',
},
{
name: 'config',
description: 'Set User configuration',
options: [{
name: 'maxshockintensity',
type: 4,
description: 'The maximum shock intensity',
required: false,
}, {
name: 'maxshockduration',
type: 4,
description: 'The maximum shock duration',
required: false,
}, {
name: 'maxvibrateintensity',
type: 4,
description: 'The maximum vibration intensity',
required: false,
}, {
name: 'maxvibrateduration',
type: 4,
description: 'The maximum vibration duration',
required: false,
}]
}
];
const rest = new REST({ version: '9' }).setToken(discordToken);
(async () => {
try {
console.log('Started refreshing application (/) commands.');
await rest.put(
Routes.applicationGuildCommands(discordClientId, discordGuildId),
{ body: commands },
);
console.log('Successfully reloaded application (/) commands.');
} catch (error) {
console.error(error);
}
})();