Expand description
Matrix implementation for botkit
This crate provides Matrix platform support for the botkit unified bot framework.
It uses the matrix-sdk crate for protocol handling, including E2E encryption.
§Example
ⓘ
use botkit_matrix::{MatrixBot, MatrixConfig};
use botkit_core::extractor::User;
async fn ping() -> &'static str { "Pong!" }
async fn greet(user: User) -> String { format!("Hello, {}!", user.name) }
let config = MatrixConfig::new("https://matrix.org")
.password_auth("@bot:matrix.org", "password")
.command_prefix("!");
MatrixBot::new(config)
.command("ping", ping)
.command("greet", greet)
.reaction("👍", on_thumbsup)
.run()
.await
.unwrap();Modules§
Structs§
- Matrix
Bot - Matrix bot builder
- Matrix
Client - Matrix client wrapper
- Matrix
Config - Matrix bot configuration
- Matrix
Context Data - Matrix context data - implements ContextData for platform abstraction
- Owned
Device Id - Owned variant of
DeviceId - Owned
Event Id - Owned variant of
EventId - Owned
Room Id - Owned variant of
RoomId - Owned
User Id - Owned variant of
UserId - Room
- A struct containing methods that are common for Joined, Invited and Left Rooms
Enums§
- Matrix
Auth - Authentication options for Matrix
- Room
State - Enum keeping track in which state the room is, e.g. if our own user is joined, RoomState::Invited, or has left the room.