
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
This is the maintenance branch for the legacy version of Botkit (< 0.7.4).
Only security and bug fix updates will be made to this branch!
If you are starting a new project, use the 4+ version found here.
You can also add Botkit into an existing Node application.
First, add it to your project:
npm install --save botkit@0.7.4
Then, add Botkit to your application code:
var Botkit = require('botkit');
var controller = Botkit.anywhere(configuration);
controller.hears('hello','direct_message', function(bot, message) {
bot.reply(message,'Hello yourself!');
});
Review the documentation to learn how to configure Botkit's controller to work with the messaging platform of your choice.
The goal of Botkit is to make it easier and more fun to build software that talks and works like a robot! Building a bot should feel cool, and not too technically complicated.
Botkit handles all the nitty gritty details like API calls, session management and authentication, allowing you to focus on building COOL FEATURES for your bot using middleware and event handlers.
The toolkit is designed to provide meaningful building blocks for creating conversational user interfaces - with functions like hears()
, ask()
, and reply()
that do what they say they do.
Most bots do their thing by listening for keywords, phrases or patterns in messages from users. Botkit has a special event handler called hears()
that makes it easy to configure your bot to listen for this type of trigger.
controller.hears(['string','pattern .*',new RegExp('.*','i')],'message_received,other_event',function(bot, message) {
// do something!
bot.reply(message, 'I heard a message.')
});
Read more about hearing things ›
Bots can respond to non-verbal events as well, like when a new user joins a channel, a file gets uploaded, or a button gets clicked. These events are handled using an event handling pattern that should look familiar. Most events in Botkit can be replied to like normal messages.
controller.on('channel_join', function(bot, message) {
bot.reply(message,'Welcome to the channel!');
});
See a full list of events and more information about handling them ›
In addition to taking direct action in response to a certain message or type of event, Botkit can also take passive action on messages as they move through the application using middlewares. Middleware functions work by changing messages, adding new fields, firing alternate events, and modifying or overriding the behavior of Botkit's core features.
Middleware can be used to adjust how Botkit receives, processes, and sends messages. Here is a list of available middleware endpoints.
// Log every message received
controller.middleware.receive.use(function(bot, message, next) {
// log it
console.log('RECEIVED: ', message);
// modify the message
message.logged = true;
// continue processing the message
next();
});
// Log every message sent
controller.middleware.send.use(function(bot, message, next) {
// log it
console.log('SENT: ', message);
// modify the message
message.logged = true;
// continue processing the message
next();
});
Join our thriving community of Botkit developers and bot enthusiasts at large. Over 6500 members strong, our open Slack group is the place for people interested in the art and science of making bots. Come to ask questions, share your progress, and commune with your peers!
You can also find help from members of the Botkit team in our dedicated Cisco Spark room!
We also host a regular meetup and annual conference called TALKABOT. Come meet and learn from other bot developers! Full video of our 2016 event is available on Youtube.
Botkit is a product of Howdy.ai.
Want to contribute? Read the contributor guide
Botkit is released under the MIT Open Source license
0.7.5
A maintenance release to the legacy branch was released as 0.7.5.
We're skipping a few version numbers here to keep in sync with the rest of Microsoft Bot Framework. Welcome to Botkit 4.5! This release contains a host of improvements and bug fixes affecting Botkit's conversation system, as well the behavior of some of the platform adapters. We recommend that all developers currently using Botkit v4 upgrade to 4.5.
Specific Changes:
NEW: It is now possible to create dynamic quick replies, and attachments within a BotkitConversation. See full docs.
NEW: Previously, there was no way to bind middleware to the internally created Express webserver. It is now possible to do so using the webserver_middlewares
parameter. Full docs
NEW: Quick replies and suggestedActions are now procssed as mustache templates. Thanks to @InnoraG for the pull request.
NEW: Slack block actions and other button clicks now are message type events and get included in dialogs. Thanks to @apemberton for the pull request.
NEW: The key name passed in to convo.ask and convo.addQuestion can now be set to null in order to discard the answer. Thanks to @adantoscano for the pull request
FIX: Botkit will no longer improperly prune platform specific fields like quick replies and attachments specified inside BotkitConversations. Fix for #1664, #1679, and #1699.
FIX: The text field in BotkitConversations was expected to always be an array, causing some confusion. It is now possible to pass in a string OR an array. Passing an array will cause Botkit to choose a random entry in the array for the message text.
FIX: Several updates have been made to the middleware pipeline so that it better matches expected behavior. The receive and send middlewares will now fire for every incoming message - previously, there were cases where these would not fire. Thanks to @adantoscano for this pull request and also this one.
FIX: The method for passing in a URI for communicating with Botkit CMS has been made more reliable, thanks to @adantoscano. See #1675 and #1677.
FIX: Webex adapter has been updated to better support file uploads. Thanks to @Teamop for the pull request
FIX: Improve mapping of Bot Framework "Activity" fields. Thanks to @Naktibalda for the pull request.
FIX: Expand typedefs for Slack dialogs. Thanks to @roger-king for the pull request
UPDATE: Update to v4.5.2 of all Bot Framework packages
UPDATE: ws
websocket module updated to v7.1.1
This update includes the following packages:
FAQs
Building Blocks for Building Bots
The npm package botkit receives a total of 5,241 weekly downloads. As such, botkit popularity was classified as popular.
We found that botkit demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.