page_type | description | products | languages | extensions | contentType | createdDate | ||||
---|---|---|---|---|---|---|---|---|---|---|
sample |
Demonstrating on how a bot can receive all channel messages with RSC without @mention. |
|
|
samples |
06-10-2021 01:48:56 |
Using this C# sample, a bot can receive all channel messages with RSC without @mention. For reference please check Receive Channel messages with RSC
This feature shown in this sample is currently available in Public Developer Preview only.
- Showing messages based on option selected
-
.NET Core SDK version 3.1
# determine dotnet version dotnet --version
-
Publicly addressable https url or tunnel such as ngrok or Tunnel Relay
- Run ngrok - point to port 3978
# ngrok http -host-header=rewrite 3978
-
Create a Bot Registration In Azure portal, create a Bot Framework registration resource.
- Ensure that you've enabled the Teams Channel
-
Modify the
manifest.json
in the/AppManifest
folder and replace the{{BOT-ID}}
with the id from step 2. -
Zip the contents of
AppManifest
folder into amanifest.zip
, and use themanifest.zip
to deploy in app store or add to Teams as in step 7. -
Modify the
/appsettings.json
and fill in the{{ Bot Id }}
,{{ Bot Password }}
with the id from step 2.
- This step is specific to Teams.
-
Edit the
manifest.json
contained in theAppManifest
folder to replace your Microsoft App Id (that was created when you registered your bot earlier) everywhere you see the place holder string<<YOUR-MICROSOFT-APP-ID>>
(depending on the scenario the Microsoft App Id may occur multiple times in themanifest.json
) also update the<<DOMAIN-NAME>>
with the ngrok URL` -
Zip up the contents of the
appPackage
folder to create amanifest.zip
-
Sideload in a team to test
- Select or create a team
- Select the ellipses ... from the left pane. The drop-down menu appears.
- Select Manage Team, then select Apps
- Then select Upload a custom app from the lower right corner.
- Then select the
manifest.zip
file fromappPackage
, and then select Add to add the bot to your selected team.
-
-
In a terminal, navigate to
ReceiveMessagesWithRSC
# change into project folder cd # ReceiveMessagesWithRSC
-
Run the bot from a terminal or from Visual Studio, choose option A or B.
A) From a terminal
# run the bot dotnet run
B) Or from Visual Studio
- Launch Visual Studio
- File -> Open -> Project/Solution
- Navigate to
ReceiveMessagesWithRSC
folder - Select
ReceiveMessagesWithRSC.csproj
file - Press
F5
to run the project
Select a channel and enter a message in the channel for your bot.
The bot receives the message without being @mentioned.
To learn more about deploying a bot to Azure, see Deploy your bot to Azure for a complete list of deployment instructions.