botframework
Advanced tools
Comparing version 0.12.1 to 0.12.2
{ | ||
"name": "botframework", | ||
"version": "0.12.1", | ||
"version": "0.12.2", | ||
"description": "Framework for messaging bots", | ||
@@ -5,0 +5,0 @@ "main": "./dist/es5/src/bot.js", |
@@ -7,3 +7,4 @@ [![Build Status](https://travis-ci.org/amitevski/botframework.svg?branch=master)](https://travis-ci.org/amitevski/botframework) | ||
Bot Framework allows you to write bots for Facebook Messenger. But it has been designed to allow integration of other bots. | ||
Bot Framework allows you to write bots for Facebook Messenger implementing MVC like controllers. | ||
But it has been designed to allow integration of other bots in future. | ||
@@ -47,2 +48,4 @@ ## Install | ||
bot.setWelcomeMessage('Hello There'); // sets up the message on the facebook welcome screen for new users | ||
function ctrl() { | ||
@@ -56,7 +59,3 @@ this.newUser = function (data) { | ||
}; | ||
// newUser?(msg: INewUserMessage, reply: IBotReply): void; | ||
// imageMessage?(imageMessage: IImageMessage, reply: IBotReply): void; | ||
// linkMessage?(linkMessage: ILinkMessage, reply: IBotReply): void; | ||
// locationMessage?(locationMessage: ILocationMessage, reply: IBotReply): void; | ||
// catchAll?(user: IBotUser, msg: Object, reply: IBotReply): void; | ||
} | ||
@@ -82,14 +81,9 @@ ``` | ||
class BotController implements IBotController { | ||
textMessage(msg: ITextMessage, reply: IBotReply): any { | ||
textMessage(msg: IBotRequest, reply: IBotReply): any { | ||
reply.text('hi'); | ||
} | ||
// newUser?(msg: INewUserMessage, reply: IBotReply): void; | ||
// imageMessage?(imageMessage: IImageMessage, reply: IBotReply): void; | ||
// linkMessage?(linkMessage: ILinkMessage, reply: IBotReply): void; | ||
// locationMessage?(locationMessage: ILocationMessage, reply: IBotReply): void; | ||
// catchAll?(user: IBotUser, msg: Object, reply: IBotReply): void; | ||
} | ||
var bot = new Bot(botSettings, new BotController()); | ||
bot.setWelcomeMessage(' | ||
bot.setWelcomeMessage('Hello There'); // sets up the message on the facebook welcome screen for new users | ||
``` | ||
@@ -105,11 +99,13 @@ | ||
export interface IBotController { | ||
newUser?(msg: INewUserMessage, reply: IBotReply): void; // handles facebook Authentication callback | ||
textMessage?(textMessage: ITextMessage, reply: IBotReply): void; // handles text only messages | ||
imageMessage?(imageMessage: IImageMessage, reply: IBotReply): void; // handles received images | ||
linkMessage?(linkMessage: ILinkMessage, reply: IBotReply): void; // handles received links from mobile phone sendTo Plugin | ||
locationMessage?(locationMessage: ILocationMessage, reply: IBotReply): void; // handles received locations | ||
catchAll?(user: IBotUser, msg: Object, reply: IBotReply): void; | ||
newUser?(request: IBotRequest, reply: IBotReply): void; // handles facebook Authentication callback | ||
textMessage?(request: IBotRequest, reply: IBotReply): void; // handles plain text messages | ||
imageMessage?(request: IBotRequest, reply: IBotReply): void; // image received | ||
linkMessage?(request: IBotRequest, reply: IBotReply): void; // link received through e.g. safari sendTo Messenger plugin | ||
locationMessage?(request: IBotRequest, reply: IBotReply): void; // user sent his location | ||
delivered?(request: IBotRequest, reply: IBotReply): void; // facebook delivery message | ||
catchAll?(request: IBotRequest, reply: IBotReply): void; // everything unhandled goes here | ||
} | ||
``` | ||
### Replying | ||
@@ -116,0 +112,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
778533
150