Skip to content

Commit

Permalink
fix chat mediator send message functions to use the abstract function
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Kwong committed Oct 19, 2023
1 parent dea5699 commit 2b9485d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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<String, IncomingMessage> 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);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ public void handleMessages(ArrayList<MessageInfo> messageInfos, Bot bot) {

System.out.println("command triggered, but does not exist " + intent.getKeyword());
this.chatMediator.sendMessageToChannel(message.getChannel(), "",
new HashMap<String, IncomingMessage>(), "text", state);
new HashMap<String, IncomingMessage>(), "text", null);
return;
}

Expand All @@ -437,7 +437,7 @@ public void handleMessages(ArrayList<MessageInfo> 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<String, IncomingMessage>(), "text", state);
new HashMap<String, IncomingMessage>(), "text", null);
return;
}
if (!intent.getKeyword().equals("exit")) {
Expand Down Expand Up @@ -757,6 +757,7 @@ public void handleMessages(ArrayList<MessageInfo> 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);
Expand Down

0 comments on commit 2b9485d

Please sign in to comment.