Actual initial commit

This commit is contained in:
Sebastian Cabrera 2023-05-22 05:47:45 -04:00
parent a389d4702d
commit bb1850e679
12 changed files with 370 additions and 1 deletions

View file

@ -0,0 +1,28 @@
package com.okseby.butler;
import ca.tristan.easycommands.EasyCommands;
import ca.tristan.easycommands.commands.defaults.HelpCmd;
import com.okseby.butler.commands.ShutdownCmd;
import net.dv8tion.jda.api.JDA;
import java.io.IOException;
public class Main {
public static void main(String[] args) throws InterruptedException, IOException {
EasyCommands easyCommands = new EasyCommands();
JDA jda = easyCommands.addExecutor( // Add your custom commands/executors here!
new HelpCmd(easyCommands),
new ShutdownCmd()
).registerListeners( // Add your custom listeners/events here!
//new ExampleListener1(),
//new ExampleListener2()
).addGatewayIntents(/*leave empty if any*/)
.addEnabledCacheFlags(/*leave empty if any*/)
.buildJDA(); // Starts the bot!
// This is kinda just to suppress an annoying IntelliJ warning.
System.out.println("JDA Status: " + jda.getStatus());
}
}

View file

@ -0,0 +1,29 @@
package com.okseby.butler.commands;
import ca.tristan.easycommands.commands.EventData;
import ca.tristan.easycommands.commands.slash.SlashExecutor;
import ca.tristan.easycommands.database.MySQL;
public class ShutdownCmd extends SlashExecutor {
@Override
public String getName() {
return "shutdown";
}
@Override
public String getDescription() {
return "Shuts down the bot";
}
@Override
public boolean isOwnerOnly() {
return false;
}
@Override
public void execute(EventData data, MySQL mySQL) {
data.reply("Goodbye!", false).queue();
data.getJda().shutdown();
}
}

View file

@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: com.okseby.butler.Main