Socket
Socket
Sign inDemoInstall

chatfuel

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    chatfuel

Install <code>npm install chatfuel</code> Usage <code>const chatfuel = require('chatfuel')</code> API Reference <li> Send Text </li> <li>


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Install size
6.79 kB
Created
Weekly downloads
 

Readme

Source

Install

npm install chatfuel

Usage

const chatfuel = require('chatfuel')

API Reference


Send Text

messages.push(chatfuel.sendText({ text: 'Hello' }))
messages.push(chatfuel.sendText({ text: 'Welcome to chatfuel' }))

Send Image

Messenger supports JPG, PNG and GIF images. If you are having issues with GIF rendering, please try to reduce the file size.

const photo = 'http://ngaoduky.com/assets/img/ngaoduky.jpg'
messages.push(chatfuel.sendImage({url:photo}))

Send Video

Messenger supports MP4 videos, which are up to 25MB in size.

const video = 'http://ngaoduky.com/assets/img/ngaoduky.mp4'
messages.push(chatfuel.sendVideo({url:video}))

Send Audio

Messenger supports MP3, OGG, WAV audios, which are up to 25MB in size

const audio = 'http://ngaoduky.com/assets/img/ngaoduky.mp3'
messages.push(chatfuel.sendAudio({url:audio}))

Send File

Files are no larger than 25 MB

const file = 'http://ngaoduky.com/assets/img/ngaoduky.pdf'
messages.push(chatfuel.sendAudio({url:file}))

Send Galleries

const title = 'Title of element'
const image_url = 'http://ngaoduky.com/assets/img/ngaoduky.jpg'
const subtitle = 'Size: M'
buttons.push(chatfuel.createButtonToURL({ url: 'https://www.facebook.com/', title: 'Go to facebook' }))
const element = chatfuel.createElement({ title, image_url, subtitle, buttons })
const elements = []
elements.push(element)
elements.push(element)
messages.push(chatfuel.sendGalleries({ elements }))

Send List

const title = 'Title of element'
const image_url = 'http://ngaoduky.com/assets/img/ngaoduky.jpg'
const subtitle = 'Size: M'
buttons.push(chatfuel.createButtonToURL({ url: 'https://www.facebook.com/', title: 'Go to facebook' }))
const element = chatfuel.createElement({ title, image_url, subtitle, buttons })
const elements = []
elements.push(element)
elements.push(element)
messages.push(chatfuel.sendLists({ elements }))

Create Button To Block

const title = 'SELECT ITEM'
const block_names = ['SELECT_ITEM']
const set_attributes = { item_id: '3' }
const buttons = []
buttons.push(chatfuel.createButtonToBlock({ title, block_names, set_attributes }))

Create Button To URL

const title = 'View My Blog'
const url = 'http://ngaoduky.com/'
const buttons = []
buttons.push(chatfuel.createButtonToURL({ url, title }))

Create Call Button

const title = 'Call me maybe'
const phone_number = '0989999999'
buttons.push(chatfuel.createCallButton({ phone_number, title }))

Create Postback Button

const title = 'Back'
const url = 'https://rockets.chatfuel.com/api/welcome'
buttons.push(chatfuel.createPostBackButton({ url, title }))

Create Quick Reply Button

const title = 'Show menu'
const block_names = ['MENU']
buttons.push(chatfuel.createQuickReplyButton({ title, block_names }))

Create Share Button

buttons.push(chatfuel.createShareButton())

Keywords

FAQs

Last updated on 30 Aug 2018

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc