Browse Source

Config + etwas dynamischer gemacht

master
Yannic Link 3 years ago
parent
commit
f5a4d178b1
3 changed files with 13 additions and 2 deletions
  1. +1
    -1
      app/src/main/java/de/yannicpunktdee/yoshibot/main/YoshiBot.java
  2. +8
    -1
      app/src/main/java/de/yannicpunktdee/yoshibot/utils/Resources.java
  3. +4
    -0
      rsc/Config.properties

+ 1
- 1
app/src/main/java/de/yannicpunktdee/yoshibot/main/YoshiBot.java View File

@ -116,7 +116,7 @@ public final class YoshiBot {
commandLineThread = new CommandLine(); commandLineThread = new CommandLine();
commandLineThread.start(); commandLineThread.start();
StatusProvider.provide(15, guild);
StatusProvider.provide(Resources.getStatus_update(), guild);
SauceProvider.init(300); SauceProvider.init(300);
//RedditProvider.init(); //RedditProvider.init();


+ 8
- 1
app/src/main/java/de/yannicpunktdee/yoshibot/utils/Resources.java View File

@ -71,6 +71,8 @@ public final class Resources {
private static String status_channel; private static String status_channel;
@Getter @Getter
private static String status_message; private static String status_message;
@Getter
private static int status_update;
private static Properties propertiesFile; private static Properties propertiesFile;
private static Properties redditCreds; private static Properties redditCreds;
@ -319,10 +321,15 @@ public final class Resources {
private static boolean initStatusMessage(){ private static boolean initStatusMessage(){
if(propertiesFile.containsKey("mc_server") && propertiesFile.containsKey("status_channel") if(propertiesFile.containsKey("mc_server") && propertiesFile.containsKey("status_channel")
&& propertiesFile.containsKey("status_message")) {
&& propertiesFile.containsKey("status_message") && propertiesFile.containsKey("status_update")) {
mc_server = propertiesFile.getProperty("mc_server"); mc_server = propertiesFile.getProperty("mc_server");
status_channel = propertiesFile.getProperty("status_channel"); status_channel = propertiesFile.getProperty("status_channel");
status_message = propertiesFile.getProperty("status_message"); status_message = propertiesFile.getProperty("status_message");
try{
status_update = Integer.parseInt(propertiesFile.getProperty("status_update"));
}catch(NumberFormatException e){
return false;
}
return true; return true;
} else return false; } else return false;
} }


+ 4
- 0
rsc/Config.properties View File

@ -2,3 +2,7 @@ guild_id=801554100814741524
# audio_source_directory=C:/Users/linky/workspace/Yoshi_Bot_Audio/ # audio_source_directory=C:/Users/linky/workspace/Yoshi_Bot_Audio/
restrict_commands_to_channel=bot-muell schrein-auf-den-bot restrict_commands_to_channel=bot-muell schrein-auf-den-bot
greetings_and_byebyes_on=true greetings_and_byebyes_on=true
mc_server=85.214.148.23
status_channel=889880296168755231
status_message=889887149850251304
status_update=30

Loading…
Cancel
Save