botas-core
    Preparing search index...

    Function removeMentionMiddleware

    • Creates a middleware that strips the bot's own @mention from incoming activity text.

      In channels like Microsoft Teams, messages directed at the bot include an <at>BotName</at> tag in activity.text. This middleware removes that tag so handlers receive the clean user intent.

      Returns TurnMiddleware

      import { BotApplication, removeMentionMiddleware } from 'botas-core'

      const bot = new BotApplication()
      bot.use(removeMentionMiddleware())

      bot.on('message', async (ctx) => {
      // ctx.activity.text no longer contains "<at>BotName</at>"
      await ctx.send(`You said: ${ctx.activity.text}`)
      })