Class TeamsChannelAdapter

Channel adapter for Microsoft Teams via Bot Framework.

Uses botbuilder and botframework-connector via dynamic imports.

Capabilities: text, rich_text, images, documents, buttons, threads, mentions, reactions, group_chat, channels.

Conversation ID format:

  • Direct: the conversation ID from Teams (opaque string)
  • Channel: <channelId> with optional replyToMessageId for threading

Hierarchy (view full)

Constructors

Methods

  • Process an incoming Bot Framework request (webhook handler). Call this from your HTTP endpoint that receives Teams webhook POSTs.

    Parameters

    • req: {
          body: unknown;
          headers: Record<string, string>;
      }

      HTTP request object.

      • body: unknown
      • headers: Record<string, string>
    • res: {
          status: ((code) => {
              send: ((body?) => void);
          });
      }

      HTTP response object.

      • status: ((code) => {
            send: ((body?) => void);
        })
          • (code): {
                send: ((body?) => void);
            }
          • Parameters

            • code: number

            Returns {
                send: ((body?) => void);
            }

            • send: ((body?) => void)
                • (body?): void
                • Parameters

                  • Optional body: unknown

                  Returns void

    Returns Promise<void>

  • Store a conversation reference for later proactive messaging. Typically called when first receiving a message from a conversation.

    Parameters

    • conversationId: string
    • reference: Record<string, unknown>

    Returns void

  • Create a new conversation with a Teams user (proactive outreach).

    Parameters

    • userId: string

      The Teams user ID to start a conversation with.

    Returns Promise<string>

    The new conversation ID.

Properties

status: ChannelConnectionStatus = 'disconnected'
connectedSince: undefined | string
errorMessage: undefined | string
platformInfo: Record<string, unknown> = {}
auth: undefined | ChannelAuthConfig & {
    params?: TeamsAuthParams;
}

Stored auth config so reconnect() can re-use it.

retryConfig: RetryConfig
platform: ChannelPlatform = 'teams'

Platform this adapter serves.

displayName: "Microsoft Teams" = 'Microsoft Teams'

Human-readable display name (e.g., "WhatsApp Business").

capabilities: readonly ChannelCapability[] = ...

Declared capabilities of this adapter.