Welcome to the Swampiest Discord bot in all the land! Like Shrek's onion, this bot has layers... of functionality!
- Make sure you've got Python 3.10+ installed (even Donkey could do this!)
- Install Poetry (it's like finding the perfect swamp, but for code):
curl -sSL https://install.python-poetry.org | python3 -
- Install the magical dependencies (they're like onion layers):
poetry install
- Create a
.env
file (your secret scroll) with your Discord token:DISCORD_TOKEN=your_magical_token_here
- Format code (make it pretty like Fiona):
poetry run black .
- Sort imports (arrange them like Shrek arranges his swamp):
poetry run isort .
- Lint code (check for ogre-sized mistakes):
poetry run pylint src
poetry run python src/bot.py
Pull the image from the magical registry (like stealing a potion from the Fairy Godmother's factory):
docker pull ghcr.io/swamp-netizens/discord-bot:main
Run it like you're running from an angry mob:
docker run -d \
--name swamp-bot \
--restart unless-stopped \
-e DISCORD_TOKEN=your_magical_token_here \
ghcr.io/swamp-netizens/discord-bot:main
-
Store your magical token on the Nomad server (like hiding Fiona in the tower):
sudo mkdir -p /etc/discord echo "your_magical_token" | sudo tee /etc/discord/token sudo chmod 600 /etc/discord/token
-
Deploy your bot (like sending Donkey on a mission):
nomad job run swamp-bot.nomad
-
Check if everything's working (like checking if your swamp is still yours):
nomad status swamp-discord-bot
The Nomad configuration is like Shrek's perfect swamp setup:
- Keeps your token safe (like Dragon guards the castle)
- Automatically restarts (like Shrek's determination to get his swamp back)
- Uses minimal resources (leaves plenty of room for the fairytale creatures)
- Always gets the latest version (fresher than morning waffles)
Our magical GitHub Actions workflow (more reliable than Fairy Godmother's potions):
- Builds faster than Gingy can run
- Pushes images automatically (like ejecting fairytale creatures from the swamp)
- Tags everything properly (better organized than Lord Farquaad's kingdom)
To use the GitHub Container Registry (the Royal Package Storage):
- Make sure your kingdom (repository) has the right permissions
- Get your special key (PAT) with
packages:read
access - Images are public by default (like an All Star song)
Remember: This bot has LAYERS! 🧅