@botbuildercommunity/middleware-activity-type

Bot Framework middleware component to handle incoming activities based on a specific activity type

Usage no npm install needed!

<script type="module">
  import botbuildercommunityMiddlewareActivityType from 'https://cdn.skypack.dev/@botbuildercommunity/middleware-activity-type';
</script>

README

Activity Type Middleware

This middleware package is a Node.JS port of the C# Activity Type middleware component from the Bot Builder Community. It intercepts messages based on the activity type so that you can automatically handle certain types outside of the standard dialog flow.

Installing

npm install @botbuildercommunity/middleware-activity-type --save

Usage

import { HandleActivityType } from '@botbuildercommunity/middleware-activity-type';

adapter.use(new HandleActivityType(ActivityTypes.Message, async (context, next) => {
    await context.sendActivity('Hello, middleware!');
}));