Skip to content

Commit

Permalink
Merge pull request #133 from rwth-acis/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
AlexanderNeumann authored Feb 5, 2023
2 parents 8ea595c + 26f46de commit 286af13
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 1 addition & 2 deletions social-bot-manager/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ dependencies {
// implementation "net.minidev:json-smart:1.3.1"
implementation "junit:junit:4.12"
implementation "javax.websocket:javax.websocket-api:1.1"
implementation "org.glassfish.tyrus.bundles:tyrus-standalone-client:1.13"

implementation "org.glassfish.tyrus.bundles:tyrus-standalone-client:1.15"
// implementation "com.github.seratch:jslack:3.4.2"
implementation "com.slack.api:slack-api-client:1.20.2"
implementation "com.slack.api:slack-api-model:1.20.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1559,7 +1559,12 @@ private void performTrigger(VLE vle, ServiceFunction sf, BotAgent botAgent, Stri
}
//client.setLogin("alice", "pwalice");
client.setLogin(botAgent.getLoginName(), botPass);

Bot bot = vle.getBots().get(botAgent.getIdentifier());
String messengerID = sf.getMessengerName();
triggeredBody.put("messenger", bot.getMessenger(messengerID).getChatService().toString());
triggeredBody.put("botName", botAgent.getIdentifier());

HashMap<String, String> headers = new HashMap<String, String>();
System.out.println(sf.getServiceName() + functionPath + " ; " + triggeredBody.toJSONString() + " "
+ sf.getConsumes() + " " + sf.getProduces() + " My string is" + ":" + triggeredBody.toJSONString());
Expand All @@ -1576,8 +1581,6 @@ private void performTrigger(VLE vle, ServiceFunction sf, BotAgent botAgent, Stri
if (Boolean.parseBoolean(triggeredBody.getAsString("contextOn"))) {
JSONParser parser = new JSONParser(JSONParser.MODE_PERMISSIVE);
try {
Bot bot = vle.getBots().get(botAgent.getIdentifier());
String messengerID = sf.getMessengerName();
JSONObject response = (JSONObject) parser.parse(r.getResponse());
System.out.println(response);
triggeredBody.put("text", response.getAsString("text"));
Expand Down

0 comments on commit 286af13

Please sign in to comment.