-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/develop' into feature-guess-lang…
…uage # Conflicts: # app/bot-config.properties.template # app/build.gradle # app/src/main/java/com/togetherjava/tjplays/Bot.java # app/src/main/java/com/togetherjava/tjplays/services/chatgpt/ChatGptService.java
- Loading branch information
Showing
10 changed files
with
111 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
BOT_TOKEN=<ENTER BOT_TOKEN> | ||
OPEN_AI_TOKEN=<ENTER OPEN_AI_TOKEN> | ||
BOT_TOKEN=<put your token here> | ||
OPENAI_API_KEY=<check pins in #tjbot_discussion for the key> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.togetherjava.tjplays; | ||
|
||
import java.util.Properties; | ||
import java.io.FileInputStream; | ||
import java.io.IOException; | ||
import java.nio.file.Path; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public final record Config( | ||
@NotNull String botToken, | ||
@NotNull String openAIApiKey | ||
) { | ||
private static final String DEFAULT_PATH = "bot-config.properties"; | ||
|
||
public static Config readConfig(@Nullable Path configPath) throws IOException { | ||
Properties properties = new Properties(); | ||
|
||
configPath = configPath == null ? Path.of(DEFAULT_PATH) : configPath; | ||
properties.load(new FileInputStream(configPath.toString())); | ||
|
||
return new Config( | ||
properties.getProperty("BOT_TOKEN"), | ||
properties.getProperty("OPENAI_API_KEY") | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters