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

Commit 357d370

Browse files
authored
Merge pull request #422 from microsoft/emimunoz/50-teams-search-extension
Teams Sample 50
2 parents 61c8b6a + c2c552c commit 357d370

File tree

5 files changed

+193
-238
lines changed

5 files changed

+193
-238
lines changed

samples/50.teams-messaging-extensions-search/README.md

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11

22
# Teams Messaging Extensions Search Bot
33

4-
Bot Framework v4 Conversation Bot sample for Teams.
54

6-
This bot has been created using [Bot Framework](https://dev.botframework.com). This sample shows
7-
how to incorporate basic conversational flow into a Teams application. It also illustrates a few of the Teams specific calls you can make from your bot.
5+
[Messaging Extensions](https://docs.microsoft.com/en-us/microsoftteams/platform/messaging-extensions/what-are-messaging-extensions) are a special kind of Microsoft Teams application that is support by the [Bot Framework](https://dev.botframework.com) v4.
6+
7+
There are two basic types of Messaging Extension in Teams: [Search-based](https://docs.microsoft.com/en-us/microsoftteams/platform/messaging-extensions/how-to/search-commands/define-search-command) and [Action-based](https://docs.microsoft.com/en-us/microsoftteams/platform/messaging-extensions/how-to/action-commands/define-action-command). This sample illustrates how to
8+
build a Search-based Messaging Extension.
89

910
## Prerequisites
1011

@@ -48,19 +49,11 @@ the Teams service needs to call into the bot.
4849
4950
## Interacting with the bot
5051
51-
You can interact with this bot by sending it a message, or selecting a command from the command list. The bot will respond to the following strings.
52+
> Note this `manifest.json` specified that the feature will be available from both the `compose` and `commandBox` areas of Teams. Please refer to Teams documentation for more details.
5253
53-
1. **Show Welcome**
54-
- **Result:** The bot will send the welcome card for you to interact with
55-
- **Valid Scopes:** personal, group chat, team chat
56-
2. **MentionMe**
57-
- **Result:** The bot will respond to the message and mention the user
58-
- **Valid Scopes:** personal, group chat, team chat
59-
3. **MessageAllMembers**
60-
- **Result:** The bot will send a 1-on-1 message to each member in the current conversation (aka on the conversation's roster).
61-
- **Valid Scopes:** personal, group chat, team chat
54+
In Teams, the command bar is located at the top of the window. When you at mention the bot what you type is forwarded (as you type) to the bot for processing. By way of illustration, this sample uses the text it receives to query the NuGet package store.
6255
63-
You can select an option from the command list by typing ```@TeamsConversationBot``` into the compose message area and ```What can I do?``` text above the compose area.
56+
There is a secondary, drill down, event illustrated in this sample: clicking on the results from the initial query will result in the bot receiving another event.
6457
6558
### Avoiding Permission-Related Errors
6659

samples/50.teams-messaging-extensions-search/pom.xml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@
7070
<artifactId>log4j-api</artifactId>
7171
<version>2.11.0</version>
7272
</dependency>
73+
<dependency>
74+
<groupId>org.json</groupId>
75+
<artifactId>json</artifactId>
76+
<version>20190722</version>
77+
</dependency>
7378
<dependency>
7479
<groupId>org.apache.logging.log4j</groupId>
7580
<artifactId>log4j-core</artifactId>
@@ -82,7 +87,17 @@
8287
<version>4.0.0-SNAPSHOT</version>
8388
<scope>compile</scope>
8489
</dependency>
85-
</dependencies>
90+
<dependency>
91+
<groupId>com.squareup.okhttp3</groupId>
92+
<artifactId>okhttp</artifactId>
93+
<version>3.12.2</version>
94+
</dependency>
95+
<dependency>
96+
<groupId>org.apache.commons</groupId>
97+
<artifactId>commons-lang3</artifactId>
98+
<version>3.10</version>
99+
</dependency>
100+
</dependencies>
86101

87102
<repositories>
88103
<repository>

samples/50.teams-messaging-extensions-search/src/main/java/com/microsoft/bot/sample/teamssearch/Application.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414

1515
/**
1616
* This is the starting point of the Sprint Boot Bot application.
17-
*
17+
* <p>
1818
* This class also provides overrides for dependency injections. A class that extends the
1919
* {@link com.microsoft.bot.builder.Bot} interface should be annotated with @Component.
2020
*
21-
* @see TeamsConversationBot
21+
* @see TeamsMessagingExtensionsSearchBot
2222
*/
2323
@SpringBootApplication
2424

0 commit comments

Comments
 (0)