Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Enable use with web-based bots #28

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/botkit-middleware-witai.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ module.exports = function(config) {
var middleware = {};

middleware.receive = function(bot, message, next) {
// Only parse messages of type text and mention the bot.
// Otherwise it would send every single message to wit (probably don't want that).
if (message.text && message.text.indexOf(bot.identity.id) > -1) {
// Only parse messages of type text
if (message.text) {
client.message(message.text, function(error, data) {
if (error) {
next(error);
Expand Down