Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.

Commit 1805cf1

Browse files
committed
Fixing PR comments
1 parent 87621a0 commit 1805cf1

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

samples/53.teams-messaging-extensions-action-preview/src/main/java/com/microsoft/bot/sample/teamsactionpreview/TeamsMessagingExtensionsActionPreviewBot.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import com.microsoft.bot.builder.MessageFactory;
99
import com.microsoft.bot.builder.TurnContext;
1010
import com.microsoft.bot.builder.teams.TeamsActivityHandler;
11-
import com.microsoft.bot.integration.Configuration;
1211
import com.microsoft.bot.sample.teamsactionpreview.models.AdaptiveCard;
1312
import com.microsoft.bot.sample.teamsactionpreview.models.Body;
1413
import com.microsoft.bot.sample.teamsactionpreview.models.Choice;
@@ -37,13 +36,6 @@
3736
*/
3837
@Component
3938
public class TeamsMessagingExtensionsActionPreviewBot extends TeamsActivityHandler {
40-
private String appId;
41-
private String appPassword;
42-
43-
public TeamsMessagingExtensionsActionPreviewBot(Configuration configuration) {
44-
appId = configuration.getProperty("MicrosoftAppId");
45-
appPassword = configuration.getProperty("MicrosoftAppPassword");
46-
}
4739

4840
@Override
4941
protected CompletableFuture<Void> onMessageActivity(
@@ -141,11 +133,8 @@ protected CompletableFuture<MessagingExtensionActionResponse> onTeamsMessagingEx
141133

142134
Activity message = MessageFactory.attachment(previewCard);
143135

144-
// THIS WILL WORK IF THE BOT IS INSTALLED. (SendActivityAsync will throw if the bot is not installed.)
145-
turnContext.sendActivity(message)
136+
return turnContext.sendActivity(message)
146137
.thenApply(resourceResponse -> null);
147-
148-
return CompletableFuture.completedFuture(null);
149138
}
150139

151140
@Override

0 commit comments

Comments
 (0)