/silverleaf-bot

A simple bot assitant for discord server

Primary LanguagePythonMIT LicenseMIT

🌿 SilverLeaf Bot

A custom Discord bot for the 🌿SilverLeaf🌿 guild community.
Features include:

  • πŸŽ‰ Auto-greetings in #introduce channel
  • πŸ‘‹ Welcome messages for new members
  • βš™οΈ Slash commands for guild management (roles, intro channel, status)
  • πŸ”„ Rotating bot status every 5 minutes
  • πŸ›‘οΈ Basic moderation commands (kick, ban)

πŸ“¦ Requirements


πŸš€ Fresh Install

1. Clone the repository

git clone https://github.com/archytech99/silverleaf-bot.git
cd silverleaf-bot

2. Create a virtual environment

python -m venv venv
source venv/bin/activate   # Linux/macOS
venv\\Scripts\\activate    # Windows PowerShell

3. Install dependencies

pip install -r requirements.txt

4. Configure environment

Create a .env file in the project root:

DISCORD_TOKEN=your_discord_bot_token_here

5. Run the bot (development)

python silverleaf-bot.py

πŸ”„ Development Mode (auto-reload)

For auto-restart on file changes:

pip install watchdog
watchmedo auto-restart --pattern="*.py;*.env" --recursive -- .venv/bin/python silverleaf-bot.py

⚑ Deployment (Debian/Ubuntu)

1. Create a systemd service /etc/systemd/system/silverleaf-bot.service

[Unit]
Description=SilverLeaf Discord Bot
After=network.target

[Service]
Type=simple
WorkingDirectory=/your-path/silverleaf-bot
ExecStart=/your-path/silverleaf-bot/.venv/bin/python silverleaf-bot.py
Restart=on-failure
User=youruser
Environment=\"DISCORD_TOKEN=your_token_here\"

[Install]
WantedBy=multi-user.target

2. Enable and start service

sudo systemctl daemon-reload
sudo systemctl enable silverleaf-bot
sudo systemctl start silverleaf-bot

3. Manage

sudo systemctl restart silverleaf-bot
sudo systemctl status silverleaf-bot
journalctl -u silverleaf-bot -f

πŸ› οΈ Useful Commands

  • /guild setintrochannel #channel β†’ set introduction channel
  • /guild removeintrochannel β†’ clear intro channel
  • /guild addrole @user @role β†’ add role to member
  • /guild removerole @user @role β†’ remove role
  • /guild setstatus [type] [message] β†’ set bot status (playing, watching, listening, competing, custom)