Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

chatfuel

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

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>

  • 1.2.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
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

Package last updated on 30 Aug 2018

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc