-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy-commands.js
72 lines (65 loc) · 2.52 KB
/
deploy-commands.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
import { REST, Routes } from "discord.js";
import "dotenv/config.js";
import { data as chatGptData } from "./commands/chatgpt.js";
import { data as dalleData } from "./commands/dalle/dall-e.js";
import { data as chatgptvoiceData } from "./commands/chatgptvoice.js";
import { data as clearQueueData } from "./commands/music/clearQueue.js";
import { data as getQueueData } from "./commands/music/getQueue.js";
import { data as pauseData } from "./commands/music/pause.js";
import { data as playData } from "./commands/music/play.js";
import { data as playlistData } from "./commands/music/playlist.js";
import { data as removeLoopData } from "./commands/music/removeLoop.js";
import { data as resumeData } from "./commands/music/resume.js";
import { data as seekData } from "./commands/music/seek.js";
import { data as setVolumeData } from "./commands/music/setVolume.js";
import { data as shuffleData } from "./commands/music/shuffle.js";
import { data as skipData } from "./commands/music/skip.js";
import { data as stopData } from "./commands/music/stop.js";
import { data as toggleLoopData } from "./commands/music/toggleLoop.js";
import { data as toggleQueueLoopData } from "./commands/music/toggleQueueLoop.js";
import { data as waifuData } from "./commands/waifu.js";
import { data as spotifyData } from "./commands/music/spotify.cjs";
const commands = [];
commands.push(chatGptData);
commands.push(dalleData);
commands.push(clearQueueData);
commands.push(getQueueData);
commands.push(pauseData);
commands.push(playData);
commands.push(playlistData);
commands.push(removeLoopData);
commands.push(resumeData);
commands.push(seekData);
commands.push(setVolumeData);
commands.push(shuffleData);
commands.push(skipData);
commands.push(stopData);
commands.push(toggleLoopData);
commands.push(toggleQueueLoopData);
commands.push(chatgptvoiceData);
commands.push(waifuData);
commands.push(spotifyData);
// Construct and prepare an instance of the REST module
const rest = new REST({ version: "10" }).setToken(
process.env.DISCORD_BOT_TOKEN
);
// Deploy commands
(async () => {
try {
console.log(
`Started refreshing ${commands.length} application (/) commands.`
);
// The put method is used to fully refresh all commands in the guild with the current set
const data = await rest.put(
Routes.applicationCommands(process.env.DISCORD_CLIENT_ID),
{
body: commands,
}
);
console.log(
`Successfully reloaded ${data.length} application (/) commands.`
);
} catch (error) {
console.error(error);
}
})();