From 9dc598d9ea6a5f87c1f07c72968778cf55878e9d Mon Sep 17 00:00:00 2001 From: jalpp <92553013+jalpp@users.noreply.github.com> Date: Mon, 4 Dec 2023 19:32:30 -0500 Subject: [PATCH] Lise update V9 --- README.md | 15 +++++++++++++++ pom.xml | 8 ++++---- src/main/java/Controller/CCProfile.java | 5 +++++ src/main/java/Controller/DailyCommand.java | 4 ++-- src/main/java/Controller/DailyCommandCC.java | 2 +- src/main/java/Controller/puzzle.java | 4 ++-- 6 files changed, 29 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 23543a5..952a714 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,21 @@ 3. [Chess.com Java Wrapper](https://github.com/sornerol/chess-com-pubapi-java-wrapper) 4. [Java Chess Lib](https://github.com/bhlangonijr/chesslib) + +# Contribution details + +To set up Lise you need the following + +- Java 18 +- Maven +- Chess.com app useragent details see more in Controller/CCProfile.java +- Discord Dev app +- Discord Dev Account +- Discord Dev app token (Note: select only Send Embeds, Send Msg, Embed links, Use Slash command permissions) +- JDA 18 knowledge, as Controller/CommandHandler.java is mostly JDA +- You don't need chess knowledge to contribute +- if your stuck join the discord server. + # Image Generation 1. [Chess Board Image](https://chessboardimage.com/) 2. [Lichess Gifs](https://github.com/lichess-org/lila-gif) diff --git a/pom.xml b/pom.xml index 4cbda18..c81310d 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,6 @@ org.apache.maven.plugins maven-compiler-plugin - 3.11.0 17 17 @@ -39,8 +38,9 @@ net.dv8tion JDA - 5.0.0-beta.2 + 5.0.0-beta.18 + com.googlecode.json-simple json-simple @@ -49,12 +49,12 @@ io.github.tors42 chariot - 0.0.67 + 0.0.77 io.github.sornerol chesscom-pubapi-wrapper - 1.2.0 + 1.4.4 com.github.bhlangonijr diff --git a/src/main/java/Controller/CCProfile.java b/src/main/java/Controller/CCProfile.java index 5f30b44..04b536f 100644 --- a/src/main/java/Controller/CCProfile.java +++ b/src/main/java/Controller/CCProfile.java @@ -29,12 +29,17 @@ public EmbedBuilder getCCProfile(){ try { + + this.playerClient = new PlayerClient(); + + playerClient.setUserAgent("your_app; username: your_username; contact: your_email"); this.embedBuilder = new EmbedBuilder(); String proSay = ""; String say = ""; + PlayerStats player = playerClient.getStatsForPlayer(this.username); proSay+= " ** Bullet**: " + diff --git a/src/main/java/Controller/DailyCommand.java b/src/main/java/Controller/DailyCommand.java index 16195a5..3876d47 100644 --- a/src/main/java/Controller/DailyCommand.java +++ b/src/main/java/Controller/DailyCommand.java @@ -49,9 +49,9 @@ public String getSolution(){ if(split[1].contains("b")){ - coordImg = "https://lichess1.org/export/fen.gif?fen=" + split[0] + "&color=white&theme=blue&piece=cardinal"; + coordImg = "https://lichess1.org/export/fen.gif?fen=" + split[0] + "&color=white&theme=brown&piece=kosal"; }else{ - coordImg = "https://lichess1.org/export/fen.gif?fen=" + split[0] + "&color=black&theme=blue&piece=cardinal"; + coordImg = "https://lichess1.org/export/fen.gif?fen=" + split[0] + "&color=black&theme=brown&piece=kosal"; } return coordImg; diff --git a/src/main/java/Controller/DailyCommandCC.java b/src/main/java/Controller/DailyCommandCC.java index 1d4e5f6..506c196 100644 --- a/src/main/java/Controller/DailyCommandCC.java +++ b/src/main/java/Controller/DailyCommandCC.java @@ -29,7 +29,7 @@ public String getPuzzle() { } this.solLink += "https://lichess.org/analysis/standard/" + fen.replace(" ", "_"); - return "https://lichess1.org/export/fen.gif?fen=" + split[0] + "&theme=blue&piece=alpha"; + return "https://lichess1.org/export/fen.gif?fen=" + split[0] + "&theme=brown&piece=kosal"; } catch (IOException | ChessComPubApiException e) { throw new RuntimeException(e); diff --git a/src/main/java/Controller/puzzle.java b/src/main/java/Controller/puzzle.java index 5b36bbb..287ffea 100644 --- a/src/main/java/Controller/puzzle.java +++ b/src/main/java/Controller/puzzle.java @@ -39,9 +39,9 @@ public String getPuzzle() { if(split[1].contains("w")){ - coordImg = "https://lichess1.org/export/fen.gif?fen=" + split[0] + "&color=white&theme=blue&piece=cardinal"; + coordImg = "https://lichess1.org/export/fen.gif?fen=" + split[0] + "&color=white&theme=brown&piece=kosal"; }else{ - coordImg = "https://lichess1.org/export/fen.gif?fen=" + split[0] + "&color=black&theme=blue&piece=cardinal"; + coordImg = "https://lichess1.org/export/fen.gif?fen=" + split[0] + "&color=black&theme=brown&piece=kosal"; }