Skip to main content

Adapters

A BotBuilder Adapter is similar to a Teams AI Plugin in the sense that they are both an abstraction that is meant to send/receive activities. To make migrating stress free we have shipped a pre-built BotBuilderPlugin that can accept a botbuilder Adapter instance.

info

this snippet shows how to use the BotBuilderPlugin to send/receive activities using botbuilder instead of the default Teams AI http plugin.

import { App } from '@microsoft/teams.apps';
import { BotBuilderPlugin } from '@microsoft/teams.botbuilder';

import adapter from './adapter';
import handler from './activity-handler';

const app = new App({
plugins: [new BotBuilderPlugin({ adapter, handler })],
});

app.on('message', async ({ send }) => {
await send('hi from teams...');
});

(async () => {
await app.start();
})();
hi from botbuilder...
hi from teams...