package de.sjanusch.configuration;

import java.io.IOException;

/**
 * Created by Sandro Janusch Date: 17.05.16 Time: 11:15
 */
public class BotConfigurationImpl implements BotConfiguration {

  private final ConfigurationLoader configurationLoader;

  public BotConfigurationImpl() {
    this.configurationLoader = new ConfigurationLoader("bot.properties");
  }

  @Override
  public String getBotNickname() throws IOException {
    return this.configurationLoader.getPropertyStringValue("bot_nickname");
  }

  @Override
  public String getBotUsername() throws IOException {
    return this.configurationLoader.getPropertyStringValue("bot_username");
  }

  @Override
  public String getBotMentionName() throws IOException {
    return this.configurationLoader.getPropertyStringValue("bot_mention_name");
  }

  @Override
  public String getBotPassword() throws IOException {
    return System.getenv("LUNCH_HIPCHAT_PASSWORD");
  }

  @Override
  public String getBotChatRoom() throws IOException {
    return this.configurationLoader.getPropertyStringValue("bot_chat_room");
  }

}

@@ -987,32 +987,156 @@
 s IOException %7B%0A
+    final String room = System.getenv(%22BOT_CHAT_ROOM%22);%0A    if (room != null && !room.isEmpty()) %7B%0A      return room;%0A    %7D%0A
     return this.

read room from env