Skip to content

Commit

Permalink
New Update
Browse files Browse the repository at this point in the history
1. Fix
  • Loading branch information
megoRU committed Jul 22, 2024
1 parent da11c23 commit 42f9f5d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
18 changes: 9 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.3.1</version>
<version>3.3.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.giveaway.bot</groupId>
Expand Down Expand Up @@ -37,7 +37,7 @@
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>5.0.0</version>
<version>5.0.1</version>
<exclusions>
<exclusion>
<groupId>club.minnced</groupId>
Expand All @@ -46,12 +46,12 @@
</exclusions>
</dependency>

<!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
<!-- &lt;!&ndash; https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.googlecode.json-simple</groupId>-->
<!-- <artifactId>json-simple</artifactId>-->
<!-- <version>1.1.1</version>-->
<!-- </dependency>-->

<!-- https://github.com/boticord/boticordjava -->
<dependency>
Expand All @@ -64,7 +64,7 @@
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>3.4.0</version>
<version>3.4.1</version>
</dependency>

<!-- https://github.com/megoRU/api.megoru.ru-wrapper -->
Expand Down
18 changes: 8 additions & 10 deletions src/main/java/main/config/BotStart.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
import net.dv8tion.jda.api.utils.cache.CacheFlag;
import org.boticordjava.api.entity.bot.stats.BotStats;
import org.boticordjava.api.impl.BotiCordAPI;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.JSONObject;
import org.json.JSONTokener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;
Expand Down Expand Up @@ -466,7 +466,7 @@ private void scheduleStartGiveaway() {
}
}

private void setLanguages() {
public void setLanguages() {
try {
List<String> listLanguages = new ArrayList<>();
listLanguages.add("rus");
Expand All @@ -476,15 +476,13 @@ private void setLanguages() {
InputStream inputStream = new ClassPathResource("json/" + listLanguage + ".json").getInputStream();

BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
JSONObject jsonObject = (JSONObject) new JSONParser().parse(reader);

for (Object o : jsonObject.keySet()) {
String key = (String) o;
JSONObject jsonObject = new JSONObject(new JSONTokener(reader));

for (String o : jsonObject.keySet()) {
if (listLanguage.equals("rus")) {
ParserClass.russian.put(key, String.valueOf(jsonObject.get(key)));
ParserClass.russian.put(o, String.valueOf(jsonObject.get(o)));
} else {
ParserClass.english.put(key, String.valueOf(jsonObject.get(key)));
ParserClass.english.put(o, String.valueOf(jsonObject.get(o)));
}
}
reader.close();
Expand All @@ -493,7 +491,7 @@ private void setLanguages() {
}
System.out.println("setLanguages()");
} catch (Exception e) {
LOGGER.log(Level.SEVERE, e.getMessage(), e);
LOGGER.info(e.getMessage());
}
}

Expand Down

0 comments on commit 42f9f5d

Please sign in to comment.