diff --git a/.gradle/6.7/executionHistory/executionHistory.bin b/.gradle/6.7/executionHistory/executionHistory.bin index 67174aa..4924485 100644 Binary files a/.gradle/6.7/executionHistory/executionHistory.bin and b/.gradle/6.7/executionHistory/executionHistory.bin differ diff --git a/.gradle/6.7/executionHistory/executionHistory.lock b/.gradle/6.7/executionHistory/executionHistory.lock index a0a5af5..6e3d99f 100644 Binary files a/.gradle/6.7/executionHistory/executionHistory.lock and b/.gradle/6.7/executionHistory/executionHistory.lock differ diff --git a/.gradle/6.7/fileHashes/fileHashes.bin b/.gradle/6.7/fileHashes/fileHashes.bin index 30d62e5..4609bf7 100644 Binary files a/.gradle/6.7/fileHashes/fileHashes.bin and b/.gradle/6.7/fileHashes/fileHashes.bin differ diff --git a/.gradle/6.7/fileHashes/fileHashes.lock b/.gradle/6.7/fileHashes/fileHashes.lock index f3d921a..e95c8db 100644 Binary files a/.gradle/6.7/fileHashes/fileHashes.lock and b/.gradle/6.7/fileHashes/fileHashes.lock differ diff --git a/.gradle/6.7/javaCompile/classAnalysis.bin b/.gradle/6.7/javaCompile/classAnalysis.bin index 136100f..5f992f1 100644 Binary files a/.gradle/6.7/javaCompile/classAnalysis.bin and b/.gradle/6.7/javaCompile/classAnalysis.bin differ diff --git a/.gradle/6.7/javaCompile/javaCompile.lock b/.gradle/6.7/javaCompile/javaCompile.lock index 854aab8..1951ba2 100644 Binary files a/.gradle/6.7/javaCompile/javaCompile.lock and b/.gradle/6.7/javaCompile/javaCompile.lock differ diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock index b3f0ab7..5c1580a 100644 Binary files a/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/build/tmp/compileJava/source-classes-mapping.txt b/build/tmp/compileJava/source-classes-mapping.txt index c4c4351..7ac3826 100644 --- a/build/tmp/compileJava/source-classes-mapping.txt +++ b/build/tmp/compileJava/source-classes-mapping.txt @@ -1,16 +1,20 @@ tech/nevets/lunarbot/config/ConfigHandler.java tech.nevets.lunarbot.config.ConfigHandler -tech/nevets/lunarbot/commands/DiceCmd.java - tech.nevets.lunarbot.commands.DiceCmd -tech/nevets/lunarbot/config/Config.java - tech.nevets.lunarbot.config.Config -tech/nevets/lunarbot/commands/CoinCmd.java - tech.nevets.lunarbot.commands.CoinCmd -tech/nevets/lunarbot/commands/InfoCmd.java - tech.nevets.lunarbot.commands.InfoCmd -tech/nevets/lunarbot/commands/PingCmd.java - tech.nevets.lunarbot.commands.PingCmd tech/nevets/lunarbot/config/ConfigUtils.java tech.nevets.lunarbot.config.ConfigUtils +tech/nevets/lunarbot/config/Config.java + tech.nevets.lunarbot.config.Config +tech/nevets/lunarbot/webserver/WebServer.java + tech.nevets.lunarbot.webserver.WebServer +tech/nevets/lunarbot/commands/games/CoinCmd.java + tech.nevets.lunarbot.commands.games.CoinCmd +tech/nevets/lunarbot/commands/wiki/InfoCmd.java + tech.nevets.lunarbot.commands.wiki.InfoCmd +tech/nevets/lunarbot/webserver/WebAPI.java + tech.nevets.lunarbot.webserver.WebAPI tech/nevets/lunarbot/Bot.java tech.nevets.lunarbot.Bot +tech/nevets/lunarbot/commands/games/DiceCmd.java + tech.nevets.lunarbot.commands.games.DiceCmd +tech/nevets/lunarbot/commands/games/PingCmd.java + tech.nevets.lunarbot.commands.games.PingCmd diff --git a/config.yml b/config.yml index 4a0f378..3f5a0a2 100644 --- a/config.yml +++ b/config.yml @@ -1,2 +1,2 @@ prefix: "$" -botToken: "ODY2ODE5NzQ2MDM2ODQyNTI2.YPYGzA.qz-ELkl_GOWZ7qbCJSNvimLPZyo" \ No newline at end of file +botToken: "ODY2ODE5NzQ2MDM2ODQyNTI2.YPYGzA.bEdQlvhZdMbvZdN5WtTvh_URJ2k" \ No newline at end of file diff --git a/src/main/java/tech/nevets/lunarbot/Bot.java b/src/main/java/tech/nevets/lunarbot/Bot.java index 671dd5b..8ca1989 100644 --- a/src/main/java/tech/nevets/lunarbot/Bot.java +++ b/src/main/java/tech/nevets/lunarbot/Bot.java @@ -10,6 +10,7 @@ import tech.nevets.lunarbot.commands.games.PingCmd; import tech.nevets.lunarbot.config.Config; import tech.nevets.lunarbot.config.ConfigHandler; import tech.nevets.lunarbot.config.ConfigUtils; +import tech.nevets.lunarbot.webserver.WebServer; import java.io.File; @@ -37,5 +38,9 @@ public class Bot { .build(); jda.awaitReady(); System.out.println("Finished Building Bot!"); + + WebServer.main(null); + System.out.println("WebServer successfully loaded in main class!"); + } } \ No newline at end of file diff --git a/src/main/java/tech/nevets/lunarbot/webapi/WebAPI.java b/src/main/java/tech/nevets/lunarbot/webserver/WebAPI.java similarity index 60% rename from src/main/java/tech/nevets/lunarbot/webapi/WebAPI.java rename to src/main/java/tech/nevets/lunarbot/webserver/WebAPI.java index 24aa617..2f8a951 100644 --- a/src/main/java/tech/nevets/lunarbot/webapi/WebAPI.java +++ b/src/main/java/tech/nevets/lunarbot/webserver/WebAPI.java @@ -1,63 +1,13 @@ -package tech.nevets.lunarbot.webapi; +package tech.nevets.lunarbot.webserver; -import java.io.BufferedReader; -import java.io.InputStreamReader; -import java.io.PrintWriter; -import java.net.ServerSocket; -import java.net.Socket; +//TODO Make up the last 3 hours of my life - Alec public class WebAPI { - public static void main(String args[]) { - WebServer ws = new WebServer(); - ws.start(); - } - } - - class WebServer { - - - protected void start() { - ServerSocket s; - - System.out.println("Webserver starting up on port 80"); - System.out.println("(press ctrl-c to exit)"); - try { - // create the main server socket - s = new ServerSocket(80); - } catch (Exception e) { - System.out.println("Error: " + e); - return; - } - - System.out.println("Waiting for connection"); - for (;;) { - try { - - Socket remote = s.accept(); - - System.out.println("Connection, sending data."); - BufferedReader in = new BufferedReader(new InputStreamReader( - remote.getInputStream())); - PrintWriter out = new PrintWriter(remote.getOutputStream()); - - String str = "."; - while (!str.equals("")) - str = in.readLine(); - - out.println("HTTP/1.0 200 OK"); - out.println("Content-Type: text/html"); - out.println("Server: Bot"); - out.println(""); - out.println("