Rive

A Rust ecosystem for Revolt.

Learn more View documentation

Main features

Simple

The internal API is designed to be as simple and straightforward as possible.

Powerful

The entire Revolt API is implemented, so it's suitable for creating custom clients, bots, etc.

Flexible

You can use only the components you need, for example, just an REST API client.

Quick example

use rive::prelude::*;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let auth = Authentication::BotToken(std::env::var("TOKEN")?);
    let mut rive = Rive::new(auth).await?;

    while let Some(event) = rive.gateway.next().await {
        if let ServerEvent::Message(message) = event? {
            if message.content.is_some_and(|c| c.starts_with("!ping")) {
                let data = SendMessageData {
                    content: Some("Pong!".to_owned()),
                    ..Default::default()
                };
                rive.http.send_message(message.channel, data).await?;
            };
        }
    }

    Ok(())
}