Skip to content

Commit 6be7565

Browse files
committed
add global commands
1 parent b05ae09 commit 6be7565

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/us/ajg0702/bots/ajsupport/SupportBot.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,13 @@ private SupportBot(JDA jda) throws InterruptedException {
8686
return;
8787
}
8888
CommandListUpdateAction commands = guild.updateCommands();
89+
CommandListUpdateAction globalCommands = jda.updateCommands();
8990
json.keySet().forEach(name -> {
9091
String value = json.get(name).getAsString();
9192
getLogger().debug("Adding command "+name);
9293

93-
commands.addCommands(Commands.slash(name, cutString(value, 100)));
94+
// commands.addCommands(Commands.slash(name, cutString(value, 100)));
95+
globalCommands.addCommands(Commands.slash(name, cutString(value, 100)));
9496
//guild.upsertCommand(name, value.substring(0, Math.min(99, value.length()))).queue();
9597
});
9698
commands.addCommands(
@@ -109,6 +111,8 @@ private SupportBot(JDA jda) throws InterruptedException {
109111
.addOption(OptionType.STRING, "reason", "The ban reason", false)
110112
);
111113
commands.queue();
114+
globalCommands.queue();
115+
112116
}).start();
113117
}
114118

0 commit comments

Comments
 (0)