npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

botbuilder-facebook-quick-replies

v1.0.0

Published

Provides an easy way to add Facebook Quick Replies to a message from bot to user with just one line of code.

Downloads

3

Readme

Facebook Quick Replies for Microsoft Bot Framework

###Short sample

const quick = require('botbuilder-facebook-quick-replies');

let message = new builder.Message(session)
  .text('I am a bot. Press buttons below.');
quick.replies(message, ['Yes', 'No']);
session.send(message);

###What's it for? This package provides a way to add Facebook Quick Replies to your bot's message. It works with bots written in Node.js using Microsoft Bot Framework (see the botbuilder package).

It supports plain-text buttons, as well as buttons with different text and underlying value. Images on quick reply buttons are not yet supported.

Most common usage

At the top of your file, add:

const builder = require('botbuilder');
const quick = require('botbuilder-facebook-quick-replies');

Then, when you are creating a message within a dialog:

// Create a plaintext message as usual:
let message = new builder.Message(session)
  .text('What do you think?');

// Now add the quick replies:
quick.replies(message, ['Cool!', 'Not bad!']);

// And send it to the user:
session.send(message);

This also works fine when your message contains attachments (like HeroCards, rather than just plain text).

When the bot must receive a different value from what the user sees

This is helpful when the button must tell the bot some additional parameters.

// Create a plaintext message as usual:
let message = new builder.Message(session)
  .text('Do you want to buy this product?');

// Now add the quick replies:
quick.replies(message, [
  { text: 'Buy Now', value: 'BUY #81571' },
  { text: 'Save for later', value 'SAVE #81571' },
]);

// And send it to the user:
session.send(message);

In this case, when the user clicks the Buy Now button, the message that the bot will actually receive is 'BUY #81571'.

###Comments and suggestions If you have any comments, contact me here: https://github.com/catcher-in-the-try/