Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

feature: add middleware to remove @mentions for MSTeams #3104

@Stevenic

Description

@Stevenic

Is your feature request related to a problem? Please describe.

Messages from MS Teams include an @mention of the bots name at the beginning of every message. This generally needs to be stripped off using ActivityExtensions.RemoveRecipientMention() otherwise TextInput actions will include it as part of the users response. I ejected my host and customized my OnTurnAsync() implementation to include the block below but we should really formalize this into a piece of middleware that can be turned on & off as a feature like the inspection middleware.

       public override async Task OnTurnAsync(ITurnContext turnContext, CancellationToken cancellationToken = default(CancellationToken))
        {
            if (turnContext.Activity.Type == "message") {
                turnContext.Activity.RemoveRecipientMention();
            }

Metadata

Metadata

Assignees

Labels

R10Release 10 - August 17th, 2020

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions