Files
W-rfel-Bot/src/main/java/core/Main.java
2019-02-18 19:26:01 +01:00

44 lines
1.0 KiB
Java
Executable File

package core;
import AtlasGruppe.groupchange;
import net.dv8tion.jda.core.JDA;
import net.dv8tion.jda.core.JDABuilder;
import net.dv8tion.jda.core.AccountType;
import net.dv8tion.jda.core.OnlineStatus;
import net.dv8tion.jda.core.entities.Game;
import javax.security.auth.login.LoginException;
public class Main {
public static void main(String[] args) {
Config conf = new Config();
conf.readConfig();
// Insert your bot's token here
//String token = "NTQ3MDc5NzgzNDE1MjgzNzEy.D0xjRw.ydeX_ou_pAqN_DCSwyGHzQUGBBk";
String token = conf.token;
JDABuilder builder = new JDABuilder(AccountType.BOT);
builder.setToken(token);
builder.setAutoReconnect(true);
builder.setStatus(OnlineStatus.ONLINE);
builder.setGame(Game.watching(conf.GameWatching));
builder.addEventListener(new groupchange(conf));
try {
JDA jda = builder.build();
}
catch (LoginException e) {
e.printStackTrace();
}
}
}