Closed wolfieboy09 closed 1 month ago
A command to see things like how many people are in the server. I started a JDA bot a while ago, and here's some code from it:
public class ServerInfoCommand extends BaseCommand { @Override public void executeCommand(@NotNull SlashCommandInteractionEvent event) { EmbedBuilder embedBuilder = new EmbedBuilder(); Guild guild = event.getGuild(); assert guild != null; String name = guild.getName(); embedBuilder.setTitle("Server Info for " + name); embedBuilder.addField("Name", name, false); embedBuilder.addField("Members", guild.getMemberCount() + " Members", false); embedBuilder.addField("Created", String.format("<t:%d:f>", ZonedDateTime.parse(guild.getTimeCreated().toString()).toEpochSecond()) , false); embedBuilder.setThumbnail(guild.getIconUrl()); event.replyEmbeds(embedBuilder.build()).queue(); } @NotNull @Override public CommandData getCommandData() { return Commands.slash("serverinfo", "Gets the server info"); } }
You would need to change it for TurtyBot to register it and such, and maybe make it better, because I touched this last MONTHS ago
Apparently it already exists, just did not know it did
A command to see things like how many people are in the server. I started a JDA bot a while ago, and here's some code from it:
You would need to change it for TurtyBot to register it and such, and maybe make it better, because I touched this last MONTHS ago