-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy-commands.js
More file actions
54 lines (43 loc) · 1.64 KB
/
Copy pathdeploy-commands.js
File metadata and controls
54 lines (43 loc) · 1.64 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
import "dotenv/config";
import { REST, Routes, SlashCommandBuilder } from "discord.js";
const commands = [
new SlashCommandBuilder()
.setName("spin")
.setDescription("I-spin ang wheel at pumili ng random na player!"),
new SlashCommandBuilder()
.setName("players")
.setDescription("Tingnan ang listahan ng mga players sa spin wheel."),
new SlashCommandBuilder()
.setName("addplayer")
.setDescription("Magdagdag ng player sa spin wheel.")
.addUserOption((opt) =>
opt.setName("user").setDescription("Ang user na idadagdag.").setRequired(true)
),
new SlashCommandBuilder()
.setName("removeplayer")
.setDescription("Tanggalin ang player sa spin wheel.")
.addUserOption((opt) =>
opt.setName("user").setDescription("Ang user na tatanggalin.").setRequired(true)
),
new SlashCommandBuilder()
.setName("addall")
.setDescription("Idagdag lahat ng miyembro ng server sa spin wheel."),
new SlashCommandBuilder()
.setName("clearplayers")
.setDescription("I-clear ang lahat ng players sa spin wheel."),
new SlashCommandBuilder()
.setName("guide")
.setDescription("Ipakita ang guide kung paano gamitin si BanatBot."),
].map((cmd) => cmd.toJSON());
const rest = new REST().setToken(process.env.DISCORD_TOKEN);
try {
console.log("⏳ Nagre-register ng slash commands...");
// Global commands (lahat ng server) — baguhin ang GUILD_ID kung gusto mo sa isang server lang
await rest.put(
Routes.applicationCommands(process.env.CLIENT_ID),
{ body: commands }
);
console.log("✅ Slash commands registered na!");
} catch (error) {
console.error("❌ Error:", error.message);
}