mirror of
https://github.com/Noratrieb/killua-bot.git
synced 2026-01-14 15:15:01 +01:00
commit
d933accd7a
2 changed files with 24 additions and 27 deletions
|
|
@ -3,7 +3,6 @@ package com.github.nilstrieb.core;
|
|||
import com.github.nilstrieb.cofig.Secrets;
|
||||
import com.github.nilstrieb.commands.info.EvalCommand;
|
||||
import com.github.nilstrieb.commands.info.HelpCommand;
|
||||
import com.github.nilstrieb.listener.CommandListener;
|
||||
import net.dv8tion.jda.api.JDA;
|
||||
import net.dv8tion.jda.api.JDABuilder;
|
||||
import net.dv8tion.jda.api.entities.Activity;
|
||||
|
|
@ -12,34 +11,19 @@ import net.dv8tion.jda.api.utils.Compression;
|
|||
import javax.security.auth.login.LoginException;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
new Main();
|
||||
|
||||
public static void main(String[] args) throws LoginException {
|
||||
JDABuilder builder = JDABuilder.createDefault(Secrets.TOKEN);
|
||||
builder.setCompression(Compression.ZLIB);
|
||||
builder.setActivity(Activity.watching(" over Gon"));
|
||||
|
||||
builder.addEventListeners(builder);
|
||||
|
||||
JDA jda = builder.build();
|
||||
setupCommands();
|
||||
}
|
||||
|
||||
public Main() {
|
||||
try {
|
||||
JDABuilder builder = JDABuilder.createDefault(Secrets.TOKEN);
|
||||
builder.setCompression(Compression.ZLIB);
|
||||
builder.setActivity(Activity.watching(" over Gon"));
|
||||
|
||||
addlisteners(builder);
|
||||
|
||||
JDA jda = builder.build();
|
||||
setupCommands();
|
||||
jda.awaitReady();
|
||||
|
||||
System.out.println("started");
|
||||
|
||||
} catch (LoginException | InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void addlisteners(JDABuilder builder){
|
||||
builder.addEventListeners(new CommandListener());
|
||||
}
|
||||
|
||||
private void setupCommands(){
|
||||
private static void setupCommands() {
|
||||
new HelpCommand();
|
||||
new EvalCommand();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
package com.github.nilstrieb.listener;
|
||||
|
||||
import net.dv8tion.jda.api.events.ReadyEvent;
|
||||
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class StartUpListener extends ListenerAdapter {
|
||||
|
||||
@Override
|
||||
public void onReady(@NotNull ReadyEvent event) {
|
||||
System.out.println("started");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue