![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.
messaging-api-messenger
Advanced tools
Messaging API client for Messenger
npm i --save messaging-api-messenger
or
yarn add messaging-api-messenger
import { MessengerClient } from 'messaging-api-line';
// get accessToken from facebook developers website
const client = MessengerClient.connect(accessToken);
async function() {
await client.sendText(recipientId, text, options);
}
or
client.sendText(recipientId, text, options).then(() => {
// do something
});
All methods return a Promise.
client.getUserProfile('1')
.then(user => {
console.log(user);
// {
// first_name: 'Johnathan',
// last_name: 'Jackson',
// profile_pic: 'https://example.com/pic.png',
// locale: 'en_US',
// timezone: 8,
// gender: 'male',
// }
});
client.sendRawBody({
recipient: {
id: '1',
},
message: {
text: 'Hello!',
},
});
client.send('1', {
text: 'Hello!',
});
client.sendText('1', 'Hello!');
client.sendIssueResolutionText('1', 'Hello!');
client.sendAttachment('1', {
type: 'image',
payload: {
url: 'https://example.com/pic.png',
},
});
client.sendAudio('1', 'https://example.com/audio.mp3');
client.sendImage('1', 'https://example.com/pic.png');
client.sendVideo('1', 'https://example.com/video.mp4');
client.sendFile('1', 'https://example.com/word.docx');
client.sendTemplate('1', {
template_type: 'button',
text: 'title',
buttons: [
{
type: 'postback',
title: 'Start Chatting',
payload: 'USER_DEFINED_PAYLOAD',
},
],
});
client.sendButtonTemplate('1', 'my_title', [
{
type: 'postback',
title: 'Start Chatting',
payload: 'USER_DEFINED_PAYLOAD',
},
]
client.sendGenericTemplate('1', [
{
title: "Welcome to Peter's Hats",
image_url: 'https://petersfancybrownhats.com/company_image.png',
subtitle: "We've got the right hat for everyone.",
default_action: {
type: 'web_url',
url: 'https://peterssendreceiveapp.ngrok.io/view?item=103',
messenger_extensions: true,
webview_height_ratio: 'tall',
fallback_url: 'https://peterssendreceiveapp.ngrok.io/',
},
buttons: [
{
type: 'postback',
title: 'Start Chatting',
payload: 'DEVELOPER_DEFINED_PAYLOAD',
},
],
},
]);
client.sendShippingUpdateTemplate('1', [
{
title: "Welcome to Peter's Hats",
image_url: 'https://petersfancybrownhats.com/company_image.png',
subtitle: "We've got the right hat for everyone.",
default_action: {
type: 'web_url',
url: 'https://peterssendreceiveapp.ngrok.io/view?item=103',
messenger_extensions: true,
webview_height_ratio: 'tall',
fallback_url: 'https://peterssendreceiveapp.ngrok.io/',
},
buttons: [
{
type: 'postback',
title: 'Start Chatting',
payload: 'DEVELOPER_DEFINED_PAYLOAD',
},
],
},
]);
client.sendReservationUpdateTemplate('1', [
{
title: "Welcome to Peter's Hats",
image_url: 'https://petersfancybrownhats.com/company_image.png',
subtitle: "We've got the right hat for everyone.",
default_action: {
type: 'web_url',
url: 'https://peterssendreceiveapp.ngrok.io/view?item=103',
messenger_extensions: true,
webview_height_ratio: 'tall',
fallback_url: 'https://peterssendreceiveapp.ngrok.io/',
},
buttons: [
{
type: 'postback',
title: 'Start Chatting',
payload: 'DEVELOPER_DEFINED_PAYLOAD',
},
],
},
]);
client.sendIssueResolutionTemplate('1', [
{
title: "Welcome to Peter's Hats",
image_url: 'https://petersfancybrownhats.com/company_image.png',
subtitle: "We've got the right hat for everyone.",
default_action: {
type: 'web_url',
url: 'https://peterssendreceiveapp.ngrok.io/view?item=103',
messenger_extensions: true,
webview_height_ratio: 'tall',
fallback_url: 'https://peterssendreceiveapp.ngrok.io/',
},
buttons: [
{
type: 'postback',
title: 'Start Chatting',
payload: 'DEVELOPER_DEFINED_PAYLOAD',
},
],
},
]);
client.sendListTemplate('1', [
{
title: 'Classic T-Shirt Collection',
image_url:
'https://peterssendreceiveapp.ngrok.io/img/collection.png',
subtitle: 'See all our colors',
default_action: {
type: 'web_url',
url: 'https://peterssendreceiveapp.ngrok.io/shop_collection',
messenger_extensions: true,
webview_height_ratio: 'tall',
fallback_url: 'https://peterssendreceiveapp.ngrok.io/',
},
buttons: [
{
title: 'View',
type: 'web_url',
url: 'https://peterssendreceiveapp.ngrok.io/collection',
messenger_extensions: true,
webview_height_ratio: 'tall',
fallback_url: 'https://peterssendreceiveapp.ngrok.io/',
},
],
},
],
[
{
type: 'postback',
title: 'Start Chatting',
payload: 'USER_DEFINED_PAYLOAD',
},
],
'compact'
);
sendAirlineFlightUpdateTemplate
client.sendQuickReplies('1', { text: 'Pick a color:' }, [
{
content_type: 'text',
title: 'Red',
payload: 'DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED',
},
]
);
client.sendSenderAction('1', 'typing_on');
client.turnTypingIndicatorsOn('1');
client.turnTypingIndicatorsOff('1');
0.2.2 / 2017-07-11
lerna
to v2.0.0
.MessengerClient.sendOpenGraphTemplate
.FAQs
Messaging API client for Messenger
The npm package messaging-api-messenger receives a total of 2,446 weekly downloads. As such, messaging-api-messenger popularity was classified as popular.
We found that messaging-api-messenger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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.