Let developers subscribe to tech stacks they care about in Discord and receive daily "master-at-a-glance" cheat sheet cards + small examples
An intelligent Discord Bot that helps developers manage and receive tech stack cheat sheets, making learning and referencing technical documentation more convenient.
- 🔔 Subscription Management: Use commands like
/stack add rustto subscribe to tech stacks you care about - 📅 Scheduled Delivery: Automatically push cheat sheets to DM daily at specified times
- 🎨 Beautiful Cards: Render Markdown cheat sheets into easy-to-read image formats
- ⚡ Instant Query: Use
/cheat <tech_stack>to get the latest cheat sheets immediately - 🌍 Multi-language Support: Support for multiple languages and timezone settings
- 🔄 Smart Caching: Automatically cache and update cheat sheet content
- 🤖 AI Examples: Optional LLM-generated code examples
Using uv (Recommended - Faster and more reliable):
# Clone the project
git clone https://github.com/your-username/Dev-Cheatsheet-Daily.git
cd Dev-Cheatsheet-Daily
# Install uv (if not already installed)
# On Windows:
# winget install astral-software.uv
# Or visit: https://docs.astral.sh/uv/getting-started/installation/
# Create virtual environment and install dependencies
uv sync
# Copy environment configuration
cp .env.example .envUsing pip (Traditional method):
# Clone the project
git clone https://github.com/your-username/Dev-Cheatsheet-Daily.git
cd Dev-Cheatsheet-Daily
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Copy environment configuration
cp .env.example .envEdit the .env file and fill in the necessary configuration:
# Discord Bot Token (Required)
DISCORD_TOKEN=your_discord_bot_token_here
# OpenAI API Key (Optional, for generating examples)
OPENAI_API_KEY=your_openai_api_key_here
# Other configurations
DATABASE_URL=sqlite:///bot.db
DEBUG=trueUsing uv:
# Direct run
uv run python main.py
# Or use the provided scripts
# Windows:
.\run.bat
# Linux/macOS:
./run.shUsing pip:
# Activate virtual environment first
source venv/bin/activate # On Windows: venv\Scripts\activate
# Run the bot
python main.py| Command | Description |
|---|---|
/stack add <lang> |
Subscribe to tech stack |
/stack remove <lang> |
Unsubscribe |
/stack list |
View subscription list |
/cheat <lang> |
Get cheat sheet immediately |
/daily time <HH:MM> |
Set delivery time |
/daily timezone <tz> |
Set timezone |
/daily info |
View delivery settings |
| Command | Description |
|---|---|
/status |
View Bot runtime status |
/cache clear [stack] |
Clear cache |
# Subscribe to Rust tech stack
/stack add rust
# Set daily delivery at 9 AM
/daily time 09:00
# Get Python cheat sheet immediately
/cheat python
# View current subscriptions
/stack list
Dev-Cheatsheet-Daily/
├── src/
│ ├── bot.py # 主 Bot 类
│ ├── config.py # 配置管理
│ ├── models/
│ │ └── database.py # 数据库模型
│ ├── cogs/ # Discord 命令组
│ │ ├── stack_commands.py
│ │ ├── cheat_commands.py
│ │ ├── daily_commands.py
│ │ └── admin_commands.py
│ ├── services/ # 核心服务
│ │ ├── cheatsheet_loader.py
│ │ ├── image_renderer.py
│ │ └── scheduler.py
│ └── utils/ # 工具函数
├── cache/ # 缓存目录
├── cheatsheets/ # 本地速查表
├── main.py # 启动入口
├── requirements.txt # 依赖列表
└── README.md
- 框架: nextcord (Discord.py v2)
- 数据库: SQLModel + SQLite
- 网络请求: httpx
- HTML 解析: BeautifulSoup4
- 图片生成: Pillow + Rich
- 任务调度: APScheduler
- AI 集成: OpenAI GPT (可选)
- 项目初始化和基础结构
- 数据库模型设计
- Discord Bot 连接
- 基本命令框架
- Cheatsheet 加载器
- 图片渲染功能
-
/stack命令组实现
-
/cheat即时查询 - 图片生成和发送
- 错误处理优化
- APScheduler 集成
- 每日推送功能
- 用户时区处理
- LLM 示例生成
- 管理员功能
- 性能优化和日志
- Fork 项目
- 创建功能分支 (
git checkout -b feature/AmazingFeature) - 提交更改 (
git commit -m 'Add some AmazingFeature') - 推送到分支 (
git push origin feature/AmazingFeature) - 开启 Pull Request
本项目采用 MIT 许可证 - 查看 LICENSE 文件了解详情。
- devhints.io - 提供优质的技术速查表
- nextcord - 强大的 Discord API 库
- Discord 开发者社区的支持和反馈