Skip to content

Luke-Larsen/Vector-SDK-Example

Repository files navigation

Vector SDK Examples

This repository contains various examples demonstrating how to use the Vector SDK (https://github.com/VectorPrivacy/Vector-SDK). Each subfolder represents a distinct project with its own objectives and contributions to the overall repository. The projects are implemented in Rust and showcase different functionalities of the Vector SDK.

Projects Overview

A simple "Hello World" example demonstrating basic setup and usage of the Vector SDK.

  • Responds to private direct messages with "Hello World"
  • Files: Cargo.toml, src/main.rs

Demonstrates how to send image responses using the Vector SDK.

  • Responds to private messages with cat images from an external API
  • Files: Cargo.toml, src/main.rs

Demonstrates sending reactions to messages using the Vector SDK.

  • Responds to private messages with checkmark reactions
  • Files: Cargo.toml, src/main.rs

Shows how to send typing message indicators using the Vector SDK.

  • Sends typing indicators before responding with "Hello World"
  • Files: Cargo.toml, src/main.rs

Combines multiple Vector SDK features into a single bot.

  • Handles private messages and supports commands: /rand, /help, /cat, /pivx
  • Demonstrates reactions, typing indicators, images, and API integration
  • Files: Cargo.toml, src/main.rs

Demonstrates joining and participating in MLS (Messaging Layer Security) group conversations.

  • Handles private direct messages and group messages
  • Automatically responds with "Hello World" to private messages and group messages
  • Files: main.rs

Advanced MLS group bot with multiple command support.

  • Joins and listens to MLS group conversations
  • Supports commands: /help, /cat
  • Demonstrates reactions, typing indicators, and images in group chats
  • Files: Cargo.toml, src/main.rs, Vector-SDK/ (local SDK version)

Demonstrates time-based message scheduling and background task management.

  • Schedule one-time messages to be sent at specific times
  • Schedule daily or weekly recurring messages
  • List and cancel scheduled messages
  • Demonstrates background task processing with Tokio
  • Files: Cargo.toml, src/main.rs
  • Commands: /schedule, /list, /cancel, /help

Demonstrates state management and data persistence between bot restarts.

  • Persists conversation history using SQLite database
  • Stores and retrieves user preferences
  • Tracks bot statistics
  • Demonstrates database schema management and migrations
  • Files: Cargo.toml, src/main.rs
  • Commands: /save, /load, /history, /stats, /help

Usage

Each project can be built and run independently. Navigate to the project directory and run:

cd <project-directory>
cargo run

For release builds:

cargo build --release
cargo run --release

Contributing

Contributions are welcome! Please feel free to submit pull requests or open issues for any feature requests or bug reports.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

example bot for using the vector SDK

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages