Repository navigation
Expand file tree
/
Copy pathdeploy.js
More file actions
109 lines (95 loc) · 3.77 KB
/
Copy pathdeploy.js
File metadata and controls
109 lines (95 loc) · 3.77 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
const { REST, Routes, SlashCommandBuilder } = require('discord.js');
require('dotenv').config();
const commands = [
new SlashCommandBuilder()
.setName('about')
.setDescription('Shows bot info')
.setIntegrationTypes([0, 1])
.setContexts([0, 1, 2]),
new SlashCommandBuilder()
.setName('uptime')
.setDescription('Shows how long DJT has been online')
.setIntegrationTypes([0, 1])
.setContexts([0, 1, 2]),
new SlashCommandBuilder()
.setName('ask')
.setDescription('Ask Mr. President something.')
.addStringOption(option =>
option
.setName('prompt')
.setDescription('What do you want to ask?')
.setRequired(true)
)
.addBooleanOption(option =>
option
.setName('private')
.setDescription(`Donald will only remember the conversation he's had with you personally`)
.setRequired(false)
)
.setIntegrationTypes([0, 1])
.setContexts([0, 1, 2]),
new SlashCommandBuilder()
.setName('clearmemory')
.setDescription(`This psyop isn't working on Donald. Wipe his shit.`)
.addBooleanOption(option =>
option
.setName('guild')
.setDescription('Wipe what Donald Trump remembers from this server (admin only)')
.setRequired(false)
)
.setIntegrationTypes([0, 1])
.setContexts([0, 1, 2]),
new SlashCommandBuilder()
.setName('setanger')
.setDescription(`Manually set how pissed off Donald is. (His orange-ness reflects how angry he is)`)
.addNumberOption(option =>
option
.setName('level')
.setDescription('Anger level from 0 to 10')
.setRequired(true)
.setMinValue(0)
.setMaxValue(10)
)
.addBooleanOption(option =>
option
.setName('guild')
.setDescription('Set the anger level for this whole server instead of just you (admin only)')
.setRequired(false)
)
.setIntegrationTypes([0, 1])
.setContexts([0, 1, 2]),
new SlashCommandBuilder()
.setName('checkanger')
.setDescription(`See how pissed off Donald currently is.`)
.addBooleanOption(option =>
option
.setName('guild')
.setDescription('Check the server-wide anger level instead of your own')
.setRequired(false)
)
.setIntegrationTypes([0, 1])
.setContexts([0, 1, 2]),
].map(command => command.toJSON());
const rest = new REST({ version: '10' }).setToken(process.env.DISCORD_TOKEN);
(async () => {
try {
console.log('Started refreshing global application (/) commands.');
const existing = await rest.get(
Routes.applicationCommands(process.env.CLIENT_ID),
);
// Entry Point commands are type 4 (PRIMARY_ENTRY_POINT), created automatically
// when Activities is enabled — must be preserved in bulk updates.
const entryPoint = existing.find(cmd => cmd.type === 4);
const body = entryPoint ? [...commands, entryPoint] : commands;
if (!entryPoint) {
console.log('No entry point command found — Activities may not be fully enabled yet.');
}
await rest.put(
Routes.applicationCommands(process.env.CLIENT_ID),
{ body },
);
console.log('Successfully reloaded global application (/) commands.');
} catch (error) {
console.error(error);
}
})();