高考倒计时 @gaokao_bot 是一个 Telegram Bot,可以实现通过发送 Message、Inline Query 方式获取当前时间的高考倒计时。
本项目使用 Go 语言实现,基于 Java 原项目的完整功能复刻。
- 倒计时查询 - 发送命令或 Inline Query 获取高考倒计时
- 定时推送 - 自动推送倒计时到指定群组
- Guest 模式 - 在 Bot 非成员的群聊/私聊中被 @提及或回复时应答默认倒计时
- Mini App - 可视化管理倒计时模板
- 多环境支持 - 开发、测试、生产环境配置分离
开启后,用户在任意聊天中 @提及 Bot(可附带年份参数,如 @gaokao_bot 2026)或回复 Bot 的消息即可获取默认模板倒计时,无需将 Bot 加入该聊天。
Guest 模式需在 BotFather 的 Mini App(/mybots → 选择 Bot → Bot Settings)中开启 Guest Mode 开关后生效,代码侧无需额外配置。
- Go 1.21+
- MySQL 8.0+
# Clone repository
git clone https://github.com/HerbertGao/gaokao_bot.git
cd gaokao_bot
# Install dependencies
go mod download
# Configure environment
cp .env.example .env
# Edit .env with your configuration
# Initialize database
mysql -u root -p < sql/init.sql
# Run
go run cmd/gaokao_bot/main.go -env=dev./scripts/build.sh
./bin/gaokao_bot -env=prod- Go 1.21+
- telego - Telegram Bot SDK
- GORM - ORM
- MySQL 8.0+
The MIT License (MIT). Please see License File for more information.