Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
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 0 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.