From 2b9485d74869b26be8b3ca2c559a85f88af6bee1 Mon Sep 17 00:00:00 2001 From: Samuel Kwong Date: Thu, 19 Oct 2023 14:36:07 +0200 Subject: [PATCH] fix chat mediator send message functions to use the abstract function --- .../services/socialBotManagerService/chat/ChatMediator.java | 5 +++-- .../services/socialBotManagerService/model/Messenger.java | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/social-bot-manager/src/main/java/i5/las2peer/services/socialBotManagerService/chat/ChatMediator.java b/social-bot-manager/src/main/java/i5/las2peer/services/socialBotManagerService/chat/ChatMediator.java index 772f23c8..76435485 100644 --- a/social-bot-manager/src/main/java/i5/las2peer/services/socialBotManagerService/chat/ChatMediator.java +++ b/social-bot-manager/src/main/java/i5/las2peer/services/socialBotManagerService/chat/ChatMediator.java @@ -64,7 +64,7 @@ public void updateBlocksMessageToChannel(String channel, String blocks, String a * @param text The content of the chat message */ public Boolean sendMessageToChannel(String channel, String text, String type ) { - return sendMessageToChannel(channel, text, null, type, null); + return sendMessageToChannel(channel, text, null, type, null, null); } /** * Sends a chat message to a channel. @@ -75,7 +75,8 @@ public Boolean sendMessageToChannel(String channel, String text, String type ) { * replies to it later on. */ public Boolean sendMessageToChannel(String channel, String text, HashMap hashMap, String type, IncomingMessage currentMessage) { - return sendMessageToChannel(channel, text, hashMap, type, currentMessage); + System.out.println("SEND MESSAGE TO CHANNEL"); + return sendMessageToChannel(channel, text, hashMap, type, currentMessage, null); } /** diff --git a/social-bot-manager/src/main/java/i5/las2peer/services/socialBotManagerService/model/Messenger.java b/social-bot-manager/src/main/java/i5/las2peer/services/socialBotManagerService/model/Messenger.java index cbfbc47f..a3e75bc7 100644 --- a/social-bot-manager/src/main/java/i5/las2peer/services/socialBotManagerService/model/Messenger.java +++ b/social-bot-manager/src/main/java/i5/las2peer/services/socialBotManagerService/model/Messenger.java @@ -427,7 +427,7 @@ public void handleMessages(ArrayList messageInfos, Bot bot) { System.out.println("command triggered, but does not exist " + intent.getKeyword()); this.chatMediator.sendMessageToChannel(message.getChannel(), "", - new HashMap(), "text", state); + new HashMap(), "text", null); return; } @@ -437,7 +437,7 @@ public void handleMessages(ArrayList messageInfos, Bot bot) { // in case a command is triggered which does not exist System.out.println("command triggered, but does not exist " + intent.getKeyword()); this.chatMediator.sendMessageToChannel(message.getChannel(), "", - new HashMap(), "text", state); + new HashMap(), "text", null); return; } if (!intent.getKeyword().equals("exit")) { @@ -757,6 +757,7 @@ public void handleMessages(ArrayList messageInfos, Bot bot) { } else { System.out.println("send msg."); + System.out.println("Current state: " + state); messageSent = this.chatMediator.sendMessageToChannel(message.getChannel(), replaceVariables(message.getChannel(), split), state.getFollowingMessages(), state.followupMessageType, state);