Skip to content

Instantly share code, notes, and snippets.

@chaintng
Last active March 19, 2019 08:35
Show Gist options
  • Save chaintng/d3f7c8847ab06b90866b9278f5c0e024 to your computer and use it in GitHub Desktop.
Save chaintng/d3f7c8847ab06b90866b9278f5c0e024 to your computer and use it in GitHub Desktop.
page2.js
// Step 1: Create rich menu, and retrieve richMenuId
client.createRichMenu({
size: { width: 2500, height: 1686 }, // Define size of rich menu
selected: true, // Always display
name: 'CryptoCurrency Page 2', // rich menu name
chatBarText: 'CryptoCurrency', // show to user
areas: [ // Area and action of each boundary
{
bounds: {
x: 0,
y: 0,
width: 833,
height: 843
},
action: {
type: 'message',
text: 'OMG'
}
}
... // And other boundary
]
})
// Step 2: Upload image to Step 1's rich menu id
client.setRichMenuImage(richMenuId, fs.createReadStream('./rich-menu/menu-page-2.jpg'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment