feat: .console discord <message>

This commit is contained in:
ChomeNS
2025-05-16 17:50:56 +07:00
parent 5f569246af
commit a60baad6f3
2 changed files with 17 additions and 1 deletions

View File

@@ -18,6 +18,7 @@ public class ConsoleCommand extends Command {
"console",
new String[] {
"server <server>",
"discord <message>",
"logtoconsole <true|false>",
"printdisconnectedreason <true|false>"
},
@@ -75,6 +76,21 @@ public class ConsoleCommand extends Command {
);
}
}
case "discord" -> {
if (Main.discord == null || Main.discord.jda == null) {
throw new CommandException(Component.translatable("commands.generic.error.discord_disabled"));
}
final String channelId = Main.discord.findChannelId(context.bot.options.discordChannel);
if (channelId == null) return null;
final String message = context.getString(true, true);
Main.discord.sendMessageInstantly(message, channelId, true);
return null;
}
case "logtoconsole" -> {
context.checkOverloadArgs(2);