~/projects/affinitybot
Published on

Affinity Bot

287 words2 min read–––
Views
Authors

AffinityBanner

Affinity Bot πŸ€–

Affinity Bot is a powerful and customizable Discord bot designed for seamless interaction and automation within the Affinity Discord server. Built using modern tools and technologies, it leverages Rust for high performance and safety and Shuttle for effortless deployment.


Features ✨

  • πŸ”§ Moderation Tools: Manage your server with commands like kick, ban, mute, and more.
  • πŸ“š Utility Commands: Fetch information, set reminders, and more!
  • πŸ”— URL Shortener: Create custom shortened URLs with the CargoΠ‘ut feature.
  • 🎡 YouTube MP3 Downloader: Extract high-quality MP3 audio from YouTube videos with a simple command.
  • ⚑ High Performance: Rust-based backend ensures speed, reliability, and memory safety.
  • πŸš€ Serverless Deployment: Leveraging Shuttle for efficient and scalable hosting.

πŸš€ High-Performance Architecture πŸ”„

The bot leverages Rust's async runtime Tokio for efficient parallel processing:

  • πŸ” Price Scraping Engine: Runs independently in a dedicated async task, continuously monitoring and updating product prices without blocking the main bot operations.
  • πŸ“¬ Notification Manager: Operates in parallel, checking and sending price alerts on configurable intervals. Uses async handlers for processing multiple notifications concurrently.
  • ⚑ Non-Blocking Design: All database operations and external API calls are fully asynchronous, ensuring optimal resource utilization and responsiveness.

Tech Stack πŸ› οΈ

  • Rust πŸ¦€: A memory-safe and fast programming language.
  • Shuttle πŸš€: A Rust-based serverless platform for easy deployment.

Getting Started 🏁

Follow these steps to set up Affinity Bot locally or deploy it to production.

Prerequisites πŸ“‹

  • Install Rust πŸ¦€: Get Rust
  • Install cargo-shuttle πŸš€:
cargo install cargo-shuttle