#facebook #messenger #bot #api-bindings #rust

russenger

A Rust library designed to simplify the handling of Facebook Messenger webhook responses

16 releases

0.3.6-rc Jan 31, 2025
0.3.3-rc Dec 26, 2024
0.3.2-rc Nov 29, 2024
0.3.0-rc Jul 22, 2024

#505 in Web programming

Download history 101/week @ 2024-11-10 15/week @ 2024-11-17 76/week @ 2024-11-24 34/week @ 2024-12-01 5/week @ 2024-12-08 99/week @ 2024-12-22 96/week @ 2024-12-29 31/week @ 2025-01-05 112/week @ 2025-01-12 5/week @ 2025-01-19 86/week @ 2025-01-26 36/week @ 2025-02-02

239 downloads per month

Apache-2.0

115KB
936 lines

Russenger

Russenger is a Rust library that makes it easy to create Facebook Messenger bots. You can check out the documentation here.

Projects using Russenger:

Features

  • ORM Integration: Built-in support for rusql-alchemy.
  • Facebook Verify Token Support: Automatically handles token verification at the /webhook endpoint when you start the application.
  • Response Types Supported:
    • Text Messages
    • GenericModel
    • QuickReply
    • Media
    • Actions (e.g., TypingOn/TypingOff)
    • PersistentMenu

Getting Started

Install cargo-generate

cargo install cargo-generate

Create a New Project

cargo generate --git https://github.com/j03-dev/russenger_template

Configuration

For more configuration, update the .env file in your project's root directory:

PORT=8000
HOST=0.0.0.0
VERIFY_TOKEN=your_verify_token
FACEBOOK_API_VERSION=v19.0
DATABASE_URL=postgres://<username>:<password>@<hostname>/<dbname>
PAGE_ACCESS_TOKEN=your_page_access_token_from_facebook_developer

Manual Setup

If you prefer a manual setup, add the following dependencies to your Cargo.toml:

[dependencies]
russenger = { version = "0.3.5-rc", features = ["postgres"] } # supports 'sqlite, postgres, mysql'
actix-web = "4"
sqlx = "^0.8.0"

Contributing

Feel free to contribute by fixing typos, improving documentation, or adding new features. Any help is appreciated!

Dependencies

~20–39MB
~698K SLoC