Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package core;
- import commands.*;
- import listeners.commandListener;
- import listeners.readyListener;
- import listeners.voiceListener;
- import net.dv8tion.jda.core.AccountType;
- import net.dv8tion.jda.core.JDA;
- import net.dv8tion.jda.core.JDABuilder;
- import net.dv8tion.jda.core.OnlineStatus;
- import net.dv8tion.jda.core.entities.Game;
- import net.dv8tion.jda.core.exceptions.RateLimitedException;
- import util.SECRETS;
- import javax.security.auth.login.LoginException;
- public class Main {
- public static JDABuilder builder;
- public static void main(String[] Args) {
- builder = new JDABuilder(AccountType.BOT);
- builder.setToken(SECRETS.TOKEN);
- builder.setAutoReconnect(true);
- builder.setStatus(OnlineStatus.ONLINE);
- builder.setGame(Game.playing("mc.impactuhc.eu"));
- addListeners();
- addCommands();
- try {
- JDA jda = builder.buildBlocking();
- } catch (LoginException e) {
- e.printStackTrace();
- } catch (InterruptedException e) {
- e.printStackTrace();
- } catch (RateLimitedException e) {
- e.printStackTrace();
- }
- }
- public static void addCommands() {
- commandHandler.commands.put("apply", new cmdApply());
- commandHandler.commands.put("twitter", new cmdTwitter());
- commandHandler.commands.put("help", new cmdHelp());
- commandHandler.commands.put("specialranks", new cmdSpecialRanks());
- commandHandler.commands.put("information", new cmdInformation());
- commandHandler.commands.put("shop", new cmdShop());
- commandHandler.commands.put("iam", new cmdIam());
- }
- public static void addListeners() {
- builder.addEventListener(new commandListener());
- builder.addEventListener(new readyListener());
- builder.addEventListener(new voiceListener());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement