Actual initial commit
This commit is contained in:
parent
a389d4702d
commit
bb1850e679
12 changed files with 370 additions and 1 deletions
28
src/main/java/com/okseby/butler/Main.java
Normal file
28
src/main/java/com/okseby/butler/Main.java
Normal 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());
|
||||
}
|
||||
}
|
29
src/main/java/com/okseby/butler/commands/ShutdownCmd.java
Normal file
29
src/main/java/com/okseby/butler/commands/ShutdownCmd.java
Normal 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();
|
||||
}
|
||||
|
||||
}
|
3
src/main/resources/META-INF/MANIFEST.MF
Normal file
3
src/main/resources/META-INF/MANIFEST.MF
Normal file
|
@ -0,0 +1,3 @@
|
|||
Manifest-Version: 1.0
|
||||
Main-Class: com.okseby.butler.Main
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue