![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
wingbot-facebook
Advanced tools
Connector plugin for wingbot chatbot framework
User loader middleware
Object
Kind: global class
string
Promise
Promise.<Array.<{message:Object, pageId:string}>>
Param | Type | Description |
---|---|---|
processor | Processor | |
options | Object | |
options.pageToken | string | facebook page token |
[options.botToken] | string | botToken for webhook verification |
[options.appSecret] | string | provide app secret to verify requests |
[options.attachmentStorage] | AttachmentCache | cache for reusing attachments |
[options.requestLib] | function | request library replacement |
[senderLogger] | console | optional console like chat logger |
string
Verifies Bots webhook against Facebook
Kind: instance method of Facebook
Throws:
Error
when the request is invalidParam | Type |
---|---|
queryString | Object |
Verify Facebook webhook event
Kind: instance method of Facebook
Throws:
Error
when x-hub-signature does not match body signatureParam | Type |
---|---|
body | Buffer | string |
headers | Object |
Promise
Kind: instance method of Facebook
Param | Type | Description |
---|---|---|
message | Object | wingbot chat event |
senderId | string | chat event sender identifier |
pageId | string | channel/page identifier |
Promise.<Array.<{message:Object, pageId:string}>>
Process Facebook request
Kind: instance method of Facebook
Returns: Promise.<Array.<{message:Object, pageId:string}>>
- - unprocessed events
Param | Type | Description |
---|---|---|
body | Object | event body |
Kind: global class
Promise
Promise
Promise
MenuComposer
Utility, which helps us to set up chatbot behavior
Promise
Sets or clears bot's greeting
Kind: instance method of Settings
Param | Type | Default | Description |
---|---|---|---|
[text] | string | false | leave empty to clear |
Promise
Sets up the Get Started Button
Kind: instance method of Settings
Param | Type | Default | Description |
---|---|---|---|
[payload] | string | Object | false | leave blank to remove button, or provide the action |
Example
const settings = new Settings(config.facebook.pageToken);
settings.getStartedButton('/start'); // just an action
Promise
Useful for using facebook extension in webviews
Kind: instance method of Settings
Param | Type |
---|---|
domains | string | Array.<string> |
MenuComposer
Sets up the persistent menu
Kind: instance method of Settings
Param | Type | Default |
---|---|---|
[locale] | string | "default" |
[inputDisabled] | boolean | false |
Example
const { Settings } = require('wingbot');
const settings = new Settings('page-token-string');
settings
.menu('fr_FR')
.addNested('Nested Menu')
.addUrl('Aller à google', 'https://google.com')
.done()
.addPostBack('Faire quelque chose', '/the/action')
.menu() // the default menu
.addNested('Nested Menu')
.addUrl('Go to google', 'https://google.com')
.done()
.addPostBack('Do something', '/the/action')
.done();
Kind: static class of Settings
Creates an instance of Settings.
Param | Type | Description |
---|---|---|
token | string | |
[log] | Object | |
[req] | function | request library for resting purposes |
Kind: global class
Param | Type | Default |
---|---|---|
onDone | function | |
[isTopLevel] | boolean | true |
this
Add postback to menu
Kind: instance method of MenuComposer
Param | Type |
---|---|
title | string |
action | string |
[data] | Object |
this
Add webview to menu
Kind: instance method of MenuComposer
Param | Type | Default |
---|---|---|
title | string | |
url | string | |
[hasExtension] | boolean | false |
[webviewHeight] | string | null |
MenuComposer
Add Nested menu component
Kind: instance method of MenuComposer
Param | Type |
---|---|
title | string |
this
| Promise
Finish the menu
Last call of "done" returns a promise
Kind: instance method of MenuComposer
MenuComposer
Finish the menu for the locale and starts a new menu
Kind: instance method of MenuComposer
Param | Type | Default |
---|---|---|
[locale] | string | "default" |
[inputDisabled] | boolean | false |
User loader middleware
Kind: global function
Param | Type |
---|---|
pageToken | string |
Example
const { userLoader } = require('wingbot-facebook');
bot.use(userLoader('<page token here>'));
bot.use((req, res) => {
const {
firstName,
lastName,
profilePic,
locale,
gender
} = req.state.user;
res.text(`Hello ${firstName}!`);
});
Object
Kind: global typedef
Properties
Name | Type |
---|---|
findAttachmentByUrl | function |
saveAttachmentId | function |
FAQs
Facebook Messenger plugin for wingbot
The npm package wingbot-facebook receives a total of 3 weekly downloads. As such, wingbot-facebook popularity was classified as not popular.
We found that wingbot-facebook 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
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.