Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
page_type description products languages extensions urlFragment
sample
Demonstrating on how a bot can receive all channel messages with RSC without @mention.
office-teams
office
office-365
csharp
contentType createdDate
samples
06-10-2021 01:48:56
officedev-microsoft-teams-samples-bot-receive-channel-messages-withRSC-csharp

Receive Channel messages with RSC permissions

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.

Key features

  • Showing messages based on option selected

Channel messages

Prerequisites

Setup

  1. Run ngrok - point to port 3978
# ngrok http -host-header=rewrite 3978
  1. Create a Bot Registration In Azure portal, create a Bot Framework registration resource.

  2. Modify the manifest.json in the /AppManifest folder and replace the {{BOT-ID}} with the id from step 2.

  3. Zip the contents of AppManifest folder into a manifest.zip, and use the manifest.zip to deploy in app store or add to Teams as in step 7.

  4. 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 the AppManifest 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 the manifest.json) also update the <<DOMAIN-NAME>> with the ngrok URL`

    • Zip up the contents of the appPackage folder to create a manifest.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 from appPackage, and then select Add to add the bot to your selected team.

App Installation

Permissions

To try this sample

  • 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

Interacting with the bot in Teams

Select a channel and enter a message in the channel for your bot.

The bot receives the message without being @mentioned.

Deploy the bot to Azure

To learn more about deploying a bot to Azure, see Deploy your bot to Azure for a complete list of deployment instructions.

Further reading