mirror of
https://github.com/tiennm99/miti99bot.git
synced 2026-09-17 18:22:26 +00:00
265b93c20294b47bcfbb7016125a4438409a9c22
Ported loldle game module with full classic-mode comparison engine: 4 commands (3 public + /loldle_setmax private), 7-attribute comparison (gender/species/range_type/resource/regions/positions/release_date) with exact/multi/year scoring, 172-champion dictionary, and sticker pools by outcome. Fixed winRate display discrepancy: JS uses Math.round but Go was using int(...) truncation. Applied math.Round in both loldle and wordle handlers. Rendered output now matches expected percentages (e.g. 67% instead of 66%). Includes comparison/lookup/flavor/state/render golden tests, keylock fan-out tests, and strict render-alignment validation.
miti99bot-go
Plug-n-play Telegram bot framework in Go, deployed on Google Cloud Run with Firestore + Gemini. Free-tier port of miti99bot.
Status
Early scaffolding. See plans/260508-2222-go-port-cloud-run/plan.md for the full roadmap.
| Phase | What | Status |
|---|---|---|
| 01 | GCP setup, Cloud Run baseline | pending |
| 02 | Repo bootstrap + webhook skeleton | partial (local pieces done; Cloud Run deploy deferred to Phase 01) |
| 03 | Module framework + KVStore | done |
| 04+ | Firestore, modules, cron, CI/CD, cutover | pending |
Layout
cmd/server/ entrypoint
internal/server/ HTTP routes (/, /webhook, /cron/{name})
internal/telegram/ Telegram webhook + bot wrapper
internal/modules/ Module framework, registry, dispatchers
internal/storage/ KVStore interface, in-memory impl, prefix wrapper
Run locally
TELEGRAM_BOT_TOKEN=… \
TELEGRAM_WEBHOOK_SECRET=local \
PORT=8080 \
MODULES= \
go run ./cmd/server
End-to-end smoke test against a Telegram dev bot requires ngrok (local) or a Cloud Run deployment. The dev bot is created manually; token is injected via env vars only.
Test
go vet ./...
go test ./...
Build
docker build -t miti99bot-go .
The image is multi-stage (golang:1.23-alpine → gcr.io/distroless/static:nonroot); resulting image is ~15 MiB.
License
Description
Plug-n-play Telegram bot framework in Go, self-hosted on Coolify + MongoDB Atlas with cron, games, schedules, and paper trading modules.
bot-frameworkcoolifycrongeminigoleague-of-legendslong-pollingmongodbmongodb-atlaspaper-tradingself-hostedtelegramtelegram-botwordleworld-cup
Readme
Apache-2.0
4.8 MiB
Languages
Go
99.9%
Dockerfile
0.1%