Telegram Bot based on http://db.chgk.info questions database.
Chgk bot supports next commands:
/start
- starts bot and shows help/help
- shows help/question
- sends random question to chat/round
- starts round of game/stop
- stops round of game/score
- shows results
You need either Docker and make, or go in order to build binary.
GOOS=linux GOARCH=amd64 go build -o bin/chgk-telegram-bot cmd/telegram/main.go
GOOS=linux GOARCH=amd64 go build -o bin/chgk-icq-bot cmd/icq/main.go
or
make compile
docker build -f build/Dockerfile.telegram -t zetraison/chgk-telegram-bot .
docker build -f build/Dockerfile.icq -t zetraison/chgk-icq-bot .
or
make docker_build
You need setup ENV variables $(TELEGRAM_BOT_TOKEN)
and $(ICQ_BOT_TOKEN)
in .env
file or in your environment to run binaries.
export TELEGRAM_BOT_TOKEN=$(TELEGRAM_BOT_TOKEN) go run cmd/telegram/main.go
export ICQ_BOT_TOKEN=$(ICQ_BOT_TOKEN) go run cmd/icq/main.go
or
make docker_run_telegram_bot
make docker_run_icq_bot
docker run -it --rm -e TELEGRAM_BOT_TOKEN=$(TELEGRAM_BOT_TOKEN) zetraison/chgk-telegram-bot
docker run -it --rm -e ICQ_BOT_TOKEN=$(ICQ_BOT_TOKEN) zetraison/chgk-icq-bot
or
make docker_run_telegram_bot
make docker_run_icq_bot