Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.
This repository was archived by the owner on Jan 5, 2026. It is now read-only.

[Skype] Group conversations: mention is not removed from Text in RemoveRecipientMention #3067

@nrobert

Description

@nrobert

System Information

  • SDK Language: C#
  • SDK Version: BotBuilder 3.8.3 (latest NuGet package)
  • Development Environment: Localhost.
  • Channel: Bug on Skype, OK on Slack

Issue Description

There is a bug on the way the Mentions are managed in Skype that is linked to the <at> tag that is added in the text of the message.

When you want to get the text of a message without the recipient mention by calling RemoveRecipientMention, the mention will not be removed from the text.

Code Example

The following code is used for the demo below:

var incomingMessage = context.Activity.AsMessageActivity();

var mentionFound = (incomingMessage.Entities?.Where(entity => String.Compare(entity.Type, "mention", ignoreCase: true) == 0).Select(e => e.Properties.ToObject<Mention>()).ToArray() ?? new Mention[0]).Where(mention => mention.Mentioned.Id == context.Activity.Recipient.Id).FirstOrDefault();
if (mentionFound != null)
{ 
    await context.PostAsync($"Activity.Text= {incomingMessage.Text}" +
        $"\n\nMention.Text= {mentionFound.Text}" +
        $"\n\nAfter RemoveRecipientMention()= { incomingMessage.RemoveRecipientMention() }" +
        $"\n\n\n\nChannelData= { Newtonsoft.Json.JsonConvert.SerializeObject(incomingMessage.ChannelData).Replace("<", "&lt;").Replace(">", "&gt;") }" +
        $"\n\nMention json= {Newtonsoft.Json.JsonConvert.SerializeObject(mentionFound).Replace("<", "&lt;").Replace(">", "&gt;")}"
        );
}

Steps to Reproduce the Issue

  1. Deploy your bot on Skype
  2. Connect to https://web.skype.com/en/?ecsoverride=developer (or use Skype App but in that case put your mention in the beginning of the message)
  3. Create a group conversation
  4. In this conversation, type a message with a mention to the bot
  5. In the bot code treating this message, call RemoveRecipientMention() on the messageText

Expected Behavior

The Text should not contain the bot name mentioned on Skype when using RemoveRecipientMention() on the message text.

Actual Results

Demo:
Valid on Slack (mention removed successfully):
image

Invalid on Skype:
image

The problem seems to be the mismatch between the Activity.Text where the <at> tag is not present and the Mention.Text which contains it.
As a consequence, the method Regex called in RemoveRecipientMention cannot do its work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or an unintended behavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions