π How to Create an Automated AI Blog with Discord, Docker, and Cloudflare
This guide shows you how to build a fully automated blog where you create posts via Discord and publish them automatically using AI.
π§ Architecture
Discord β Bot β AI β GitHub β Hugo β Cloudflare Pages
π¦ Prerequisites
- GitHub\
- Cloudflare\
- Linux Server (Ubuntu)\
- Docker\
- Discord\
- AI API
π§ Server Setup
sudo apt update && sudo apt upgrade -y
sudo apt install docker.io -y
sudo systemctl enable docker
sudo systemctl start docker
Docker Permission:
sudo usermod -aG docker $USER
π€ Bot on Discord
- Create application\
- Add bot\
- Copy token\
- Enable MESSAGE CONTENT INTENT
π Environment Variables
OPENROUTER_API_KEY=
GITHUB_TOKEN=
REPO_BLOG=
DISCORD_TOKEN=
β οΈ Never version .env
π Project Structure
project/
βββ main.py
βββ blog/
β βββ content/posts/
βββ scripts/
βββ .env
π§ Bot Functionalities
!write
!preview
!publish
!posts
!delete
!rename
!retranslate
π Multi-language
post.pt.md
post.en.md
post.es.md
βοΈ Cloudflare Pages
Build:
cd blog && hugo –gc –minify
Output:
blog/public
π Auto deploy
Script detects changes in Git and restarts the container only when necessary.
β±οΈ Cron
*/2 * * * * bash update-bot.sh >> log.log 2>&1
π Result
- Content via Discord\
- Automatic publication\
- Continuous deployment\
- Multi-language
π§ Conclusion
You have created a modern, automated, and scalable blog.