
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.
botkit-messenger-samples
Advanced tools
Module to receive sample messages of all types from a Facebook Messenger chatbot
Module to receive sample messages of most types from a Facebook Messenger chatbot.
Takes the idea of sample message types from the Facebook Messenger Platform Sample project and moves it into a module for Botkit.
For usage sample code see examples/sample_bot.js
Install library from npm
npm install --save botkit-messenger-samples
Import Library
const MessengerSamples = require('botkit-messenger-samples');
Init the Library
controller.setupWebserver(process.env.port,function(err, webserver) {
var messengerSamples = new MessengerSamples(controller, bot, {
// serverUrl (e.g., https://my.domain.com)
// needed to server up sample images
serverUrl: process.env.serverUrl
//, replyCb = function(err, body) {
// // call after a sample message is sent
// }
});
});
Command | Results |
---|---|
sample:help | text list of available commands |
sample:audio | an Audio Attachment embedded in a player |
sample:button | a Button Template |
sample:file | a text File Attachment |
sample:generic | a Generic Template |
sample:gif | an animated GIF Image Attachment |
sample:image | an Image Attachment |
sample:image:tall | a very tall Image Attachment |
sample:image:wide | a very wide Image Attachment |
sample:list | a List Template top_element_style:large note: on web, it is rendered as compact |
sample:list:compact | a List Template top_element_style:compact |
sample:quick reply | a text message with Quick Replies |
sample:read receipt | the mark_seen Sender Action |
sample:receipt | a Receipt Template |
sample:typing on | the typing_on Sender Action |
sample:typing off | the typing_off Sender Action |
sample:video | a Video Attachment embedded in a player |
| any message type; after the sample:json: add any valid message, see Send API Reference |
Simple text
sample:json:{
"text": "hello world"
}
Muliple messages
sample:json:[{
"text": "hello world"
},{
"attachment": {
"type": "template",
"payload": {
"template_type": "generic",
"elements": [
{
"title": "rift",
"subtitle": "Next-generation virtual reality",
"item_url": "https://www.oculus.com/en-us/rift/",
"image_url": "http://assets.smalltalk.ai/sample-message/rift.png",
"buttons": [
{
"type": "web_url",
"url": "https://www.oculus.com/en-us/rift/",
"title": "Open Web URL"
},
{
"type": "postback",
"title": "Call Postback",
"payload": "Payload for first bubble"
}
]
},
{
"title": "touch",
"subtitle": "Your Hands, Now in VR",
"item_url": "https://www.oculus.com/en-us/touch/",
"image_url": "http://assets.smalltalk.ai/sample-message/touch.png",
"buttons": [
{
"type": "web_url",
"url": "https://www.oculus.com/en-us/touch/",
"title": "Open Web URL"
},
{
"type": "postback",
"title": "Call Postback",
"payload": "Payload for second bubble"
}
]
}
]
}
}
}]
FAQs
Module to receive sample messages of all types from a Facebook Messenger chatbot
The npm package botkit-messenger-samples receives a total of 2 weekly downloads. As such, botkit-messenger-samples popularity was classified as not popular.
We found that botkit-messenger-samples 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.