Skip to content

A modern Discord invite management bot written in Rust.

License

Notifications You must be signed in to change notification settings

lekoOwO/InvitationBot

Repository files navigation

🎫 InvitationBot

A modern Discord invite management bot written in Rust

Rust Discord License

✨ Features

  • 🔒 Secure Invite Management: Generate and track single-use invite links
  • 👥 Role-based Permissions: Configure invite limits per role
  • 📊 Invite Statistics: Track who invited whom and view leaderboards
  • 🌐 Web Integration: Custom invite landing pages
  • 🌍 i18n Support: Available in English and Traditional Chinese

🚀 Quick Start

  1. Clone the repository:
git clone https://github.com/lekoOwO/InvitationBot
cd invitationbot
  1. Configure your bot:
mkdir data
cp config.example.yaml data/config.yaml
# Edit config.yaml with your settings

Bot must have these permissions in the invite channel:

  • Attach Files
  • Create Instant Invite
  • Embed Links
  • Manage Channels
  • Read Message History
  • Send Messages (Or Send Messages in Threads)
  • Use Slash Commands
  1. Run the bot:
# Set up the database
echo "DATABASE_URL=sqlite:data/bot.db" > .env
echo "CONFIG_PATH=data/config.yaml" >> .env

cargo run --release

🛠️ Configuration

The bot is configured through two main files:

config.yaml

bot:
  token: "YOUR_BOT_TOKEN"
  default_invite_max_age: 300  # Default 5 minutes

database:
  path: "data/bot.db"  # SQLite database path

# ... other configurations

Environment Variables

DATABASE_URL=sqlite:data/bot.db  # SQLite connection string
CONFIG_PATH=data/config.yaml  # Config file path

🚨 Caution

  • The config file is in plain text, so please do not share it with others.
  • The config page is accessible by anyone by default, so please set up a proper authentication method.

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

📦 Dependencies

  • poise - Discord bot framework
  • sqlx - Async SQL toolkit
  • axum - Web framework
  • tokio - Async runtime

📝 License

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

🙏 Acknowledgments


Made with ❤️ and 🦀