Skip to content

Commit

Permalink
Update PetStoreAssistantBot.java
Browse files Browse the repository at this point in the history
  • Loading branch information
chtrembl committed Jan 9, 2024
1 parent 3339c14 commit 9da6203
Showing 1 changed file with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,29 @@ protected CompletableFuture<Void> onMembersAdded(
// .collect(CompletableFutures.toFutureList()).thenApply(resourceResponses ->
// null);

LOGGER.info("onMembersAdded...");

String text = turnContext.getActivity().getText().toLowerCase().trim();

LOGGER.info("onMembersAdded incoming text: " + text);
LOGGER.info("incoming text: " + text);


if (isErroneousRequest(text)) {
return null;
}

AzurePetStoreSessionInfo azurePetStoreSessionInfo = configureSession(turnContext, text);

if (azurePetStoreSessionInfo != null && azurePetStoreSessionInfo.getNewText() != null) {
// get the text without the session id and csrf token
text = azurePetStoreSessionInfo.getNewText();
}

// the client browser initialized
if (text.equals("...")) {
return turnContext.sendActivity(
MessageFactory.text(WELCOME_MESSAGE)).thenApply(sendResult -> null);
}

return turnContext.sendActivity(
MessageFactory.text("")).thenApply(sendResult -> null);
Expand Down

0 comments on commit 9da6203

Please sign in to comment.