Skip to content

Commit

Permalink
Adjust logging
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderNeumann committed Oct 20, 2023
1 parent 75bb4ad commit 8ff2752
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3147,6 +3147,7 @@ public Response handleRESTfulChat(@PathParam("bot") String bot, @PathParam("orga
RESTfulChatResponse oldAnswerMsg = answerMsg;

answerMsg = chatMediator.getMessageForChannel(orgChannel);
System.out.println("Set msg to: "+answerMsg.getMessage);
if ((oldAnswerMsg.getMessage() != answerMsg.getMessage())
|| (answerMsg.getMessage().contains(oldAnswerMsg.getMessage()))) {
// answerMsg.setMessage(oldAnswerMsg.getMessage() + "\n" +
Expand Down Expand Up @@ -3288,10 +3289,10 @@ private void performTrigger(BotConfiguration botConfig, ServiceFunction sf, BotA
.post(javax.ws.rs.client.Entity.entity(mp, mp.getMediaType()));
System.out.println("Response Code:" + response.getStatus());
System.out.println("Response Entitiy:" + response.getEntity());
System.out.println("Response Text:" + response.readEntity(String.class));
}

String test = response.readEntity(String.class);
System.out.println("Response Text:" + test);
mp.close();
try {
java.nio.file.Files.deleteIfExists(Paths.get(triggeredBody.getAsString("fileName") + "."
Expand All @@ -3308,7 +3309,6 @@ private void performTrigger(BotConfiguration botConfig, ServiceFunction sf, BotA
JSONObject jsonResponse = (JSONObject) parser.parse(test);
for (String key : jsonResponse.keySet()) {
bot.getMessenger(messengerID).addVariable(channel, key, jsonResponse.getAsString(key));
System.out.println(key);
}
bot.getMessenger(messengerID).setContextToBasic(channel,
userId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,14 +334,14 @@ public void addVariable(String channel, String key, String value) {

public String replaceVariables(String channel, String text) {
HashMap<String, String> variables = this.getUserVariables().get(channel);
if (variables != null) {
if (variables != null || !variables.isEmpty()) {
for (String key : variables.keySet()) {
System.out.println("Replace Variable Key:" + key);
String composed = "[" + key + "]";
text = text.replace(composed, variables.get(key));
}
} else {
System.out.println("Replace Variables are null.");
System.out.println("Replace Variables are null or empty.");
}
String split[] = text.split("\\[");
for (int i = 1; i < split.length; i++) {
Expand Down

0 comments on commit 8ff2752

Please sign in to comment.