Advertisement
Guest User

Untitled

a guest
Dec 17th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. package core;
  2.  
  3. import commands.*;
  4. import listeners.commandListener;
  5. import listeners.readyListener;
  6. import listeners.voiceListener;
  7. import net.dv8tion.jda.core.AccountType;
  8. import net.dv8tion.jda.core.JDA;
  9. import net.dv8tion.jda.core.JDABuilder;
  10. import net.dv8tion.jda.core.OnlineStatus;
  11. import net.dv8tion.jda.core.entities.Game;
  12. import net.dv8tion.jda.core.exceptions.RateLimitedException;
  13. import util.SECRETS;
  14.  
  15. import javax.security.auth.login.LoginException;
  16.  
  17. public class Main {
  18.  
  19.  
  20. public static JDABuilder builder;
  21.  
  22. public static void main(String[] Args) {
  23.  
  24. builder = new JDABuilder(AccountType.BOT);
  25.  
  26. builder.setToken(SECRETS.TOKEN);
  27. builder.setAutoReconnect(true);
  28.  
  29. builder.setStatus(OnlineStatus.ONLINE);
  30.  
  31. builder.setGame(Game.playing("mc.impactuhc.eu"));
  32.  
  33.  
  34. addListeners();
  35. addCommands();
  36.  
  37. try {
  38. JDA jda = builder.buildBlocking();
  39. } catch (LoginException e) {
  40. e.printStackTrace();
  41. } catch (InterruptedException e) {
  42. e.printStackTrace();
  43. } catch (RateLimitedException e) {
  44. e.printStackTrace();
  45. }
  46.  
  47.  
  48. }
  49.  
  50. public static void addCommands() {
  51.  
  52.  
  53. commandHandler.commands.put("apply", new cmdApply());
  54. commandHandler.commands.put("twitter", new cmdTwitter());
  55. commandHandler.commands.put("help", new cmdHelp());
  56. commandHandler.commands.put("specialranks", new cmdSpecialRanks());
  57. commandHandler.commands.put("information", new cmdInformation());
  58. commandHandler.commands.put("shop", new cmdShop());
  59. commandHandler.commands.put("iam", new cmdIam());
  60.  
  61. }
  62.  
  63. public static void addListeners() {
  64.  
  65. builder.addEventListener(new commandListener());
  66. builder.addEventListener(new readyListener());
  67. builder.addEventListener(new voiceListener());
  68.  
  69.  
  70. }
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement