rmessenger

Crates.iormessenger
lib.rsrmessenger
version0.0.4
sourcesrc
created_at2016-09-29 12:29:46.74824
updated_at2016-10-04 06:32:56.071525
descriptionA Rust Wrapper for the FaceBook Messenger Bot API
homepage
repositoryhttps://github.com/nocotan/rmessenger
max_upload_size
id6661
size7,732
Masanari KIMURA (nocotan)

documentation

README

rmessenger

MIT License

##A Rust Wrapper for the FaceBook Messenger Bot API Facebook's Messenger Platform
crates.io: rmessenger

###About you can:

  • send text message
  • send generic message
  • send button message
  • send file url
  • send audio url

###Installation

####Cargo.toml

rmessenger = "0.0.3"

###Usage

####Send text message https://developers.facebook.com/docs/messenger-platform/send-api-reference/text-message

extern crate rmessenger;
use rmessenger::bot;

fn main() {
    let bot = bot::Bot::new("<YOUR ACCESS TOKEN>", "<YOUR APP SECRET>");
    bot.send_text_message("<recipient_id>", "<message>");
}

####Send generic message

extern crate rmessenger;
use rmessenger::bot;

fn main() {
    let bot = bot::Bot::new("<YOUR ACCESS TOKEN>", "<YOUR APP SECRET>");
    bot.send_generic_message("<recipient_id>>",
                             "[{'title': 'example',
                                'image_url': 'https://petersfancybrownhats.com/company_image.png'
                                }]");
}

elements param is &str

###TODO

  • send image
  • send file
  • send audio
  • send video
Commit count: 76

cargo fmt