botfriends-handover-nodejs
Version:
NodeJs wrapper for BOTfriends Handover Tool
30 lines (27 loc) • 669 B
JavaScript
const { HandoverClient } = require('botfriends-handover-nodejs')
// init HandoverClient
const handover = new HandoverClient(jwt, backendUrl)
// sendCarousel
handover.sendCarousel('some-user', {
role: 'user',
text: 'Just sending a carousel',
source: 'web',
items: [{
title: 'First Item',
descripton: 'This is the first item',
mediaUrl: 'paste image link here',
actions: [{
text: 'Button1',
type: 'postback',
payload: 'action1'
},{
text: 'Button2',
type: 'link',
uri: 'paste link here'
}],
size: 24
}]
}
).catch(err => {
// do something with the error
})