botas-express
    Preparing search index...

    Interface TurnContext

    Context for a single activity turn, passed to handlers and middleware.

    Provides the incoming activity, a reference to the bot application, and a scoped send method that automatically routes replies back to the originating conversation.

    bot.on('message', async (ctx) => {
    await ctx.send(`You said: ${ctx.activity.text}`)
    })
    interface TurnContext {
        activity: CoreActivity;
        app: BotApplication;
        send(
            activityOrText: string | Partial<CoreActivity>,
        ): Promise<ResourceResponse | undefined>;
        sendTyping(): Promise<void>;
    }
    Index

    Properties

    Methods

    Properties

    activity: CoreActivity

    The incoming activity being processed.

    The BotApplication instance processing this turn.

    Methods

    • Send a reply to the conversation that originated this turn.

      Accepts a plain text string (sent as a message activity) or a partial CoreActivity for full control over the reply payload. Routing fields are automatically populated from the incoming activity.

      Parameters

      Returns Promise<ResourceResponse | undefined>

    • Send a typing indicator to the conversation.

      Notifies the user that the bot is processing their request. Routing fields are automatically populated from the incoming activity.

      Returns Promise<void>

      bot.on('message', async (ctx) => {
      await ctx.sendTyping()
      // ... perform long-running operation ...
      await ctx.send('Operation complete!')
      })