Examples
Vector SDK Examples & Application
Vector SDK Examples
This repository contains various examples demonstrating how to use the 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,/pivxDemonstrates 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,/catDemonstrates 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.rsCommands:
/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.rsCommands:
/save,/load,/history,/stats,/help
Usage
Each project can be built and run independently. Navigate to the project directory and run:
For release builds:
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.
Last updated