This bot combines multiple features of the Vector SDK into a single bot. It demonstrates how to handle private direct messages, send reactions, typing indicators, and images. It also includes command-based interaction with users.
- Handles private direct messages
- Supports commands like
/rand,/help,/cat, and/pivx - Sends reactions, typing indicators, and images
- Fetches data from external APIs
- Rust toolchain (stable version)
- Cargo package manager
- vector_sdk
- tokio
- reqwest
- log
- serde_json
- rand
To start the bot, navigate to the project directory and run:
cd Multi-command
cargo runFor release builds:
cargo build --release
cargo run --releaseThe bot uses a hardcoded private key for demonstration purposes. In production, you should:
- Generate your own keys using
Keys::generate() - Store the private key securely
- Use environment variables or configuration files for sensitive data
The bot supports several commands that can be sent as private messages:
/rand: Get a random number/help: Display available commands/cat: Get a random cat image/pivx [currency]: Get the current PIVX price in the specified currency (default: USD)
src/main.rs: Main entry point of the applicationCargo.toml: Project dependencies and configuration
Contributions are welcome! Please feel free to submit issues or pull requests.
This project is licensed under the MIT License. See the LICENSE file for details.
- Nostr protocol developers
- Rust community