Advertisement
Guest User

Untitled

a guest
Jun 10th, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.57 KB | None | 0 0
  1. package io.osu.konosuba;
  2.  
  3. import io.osu.konosuba.Listeners.CommandListener;
  4. import io.osu.konosuba.Listeners.StartupListener;
  5. import net.dv8tion.jda.bot.sharding.DefaultShardManagerBuilder;
  6. import components.simplereader.SimpleReader;
  7. import components.simplereader.SimpleReader1L;
  8. import org.slf4j.Logger;
  9. import org.slf4j.LoggerFactory;
  10.  
  11. import javax.security.auth.login.LoginException;
  12. import java.awt.Color;
  13. import java.sql.Connection;
  14. import java.sql.DriverManager;
  15. import java.util.Scanner;
  16.  
  17. public class Konosuba {
  18.  
  19. //public static final Logger LOGGER = LoggerFactory.getLogger(Konosuba.class);
  20.  
  21. private static Scanner key = new Scanner((System.getProperty("user.home") + "/Desktop/Konosuba/key.txt"));
  22. private static final String KOBOSUBA_TOKEN = key.nextLine();
  23.  
  24. // This is now the default color for commands
  25. public static final Color COLOR = new Color(153,50,204);
  26.  
  27. // This is now the default prefix for commands
  28. public static final String PREFIX = "*";
  29.  
  30. // This is the default logger
  31. public static final Logger LOGGER = LoggerFactory.getLogger(Konosuba.class);
  32.  
  33. //this is for pulling information
  34. public static Connection CONNECTION1;
  35. static {
  36. try {
  37. String dbPath = System.getProperty("user.home") + (System.getProperty("user.home").startsWith("/home") ? "/konosuba.db" : "/Desktop/Stuff/git/KonosubaBot/Data/konosuba.db");
  38. //noinspection SpellCheckingInspection
  39. Class.forName("org.sqlite.JDBC");
  40. //noinspection SpellCheckingInspection
  41. CONNECTION1 = DriverManager.getConnection("jdbc:sqlite:" + dbPath);
  42. } catch (Exception e) {
  43. e.printStackTrace();
  44. CONNECTION1 = null;
  45. System.exit(0);
  46. }
  47. }
  48.  
  49. public static Connection CONNECTION2;
  50. static {
  51. try {
  52. String dbPath = System.getProperty("user.home") + (System.getProperty("user.home").startsWith("/home") ? "/konosuba.db" : "/Desktop/Stuff/git/KonosubaBot/Data/konosuba-registry.db");
  53.  
  54. //noinspection SpellCheckingInspection
  55. Class.forName("org.sqlite.JDBC");
  56. //noinspection SpellCheckingInspection
  57. CONNECTION2 = DriverManager.getConnection("jdbc:sqlite:" + dbPath);
  58. } catch (Exception e) {
  59. e.printStackTrace();
  60. CONNECTION2 = null;
  61. System.exit(0);
  62. }
  63. }
  64.  
  65.  
  66. public static void main(String[] args) throws LoginException {
  67. //noinspection SpellCheckingInspection
  68. new DefaultShardManagerBuilder()
  69. .setToken(KOBOSUBA_TOKEN)
  70. .addEventListeners(new CommandListener())
  71. .addEventListeners(new StartupListener())
  72. .setBulkDeleteSplittingEnabled(false)
  73. // .setShardsTotal(1) // XXX DO NOT USE THIS!
  74. .build();
  75.  
  76.  
  77. }
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement