This is a template for a Telegram Bot written in Go. It uses a code-generated wrapper to interact with the Telegram Bot API.
- Talk to BotFather and create a bot. You will get a token, keep it safe.
- For development purposes, we recommend running this with a tool such as ngrok.
Simply install ngrok, copy
ngrok.dist.yamltongrok.yaml, set yourauthtoken, and runngrok start --config=ngrok.yaml bot_webhook web_app. - Use this template to create a repo for your bot, clone it to your local dev environment.
- Copy
config.dist.yamltoconfig.yaml, fill in your bot token and other parameters. - Run
go run .to start the bot. - Then, simply send
/startto your bot; if it replies, you've successfully set up your bot!
- Viper for config handling
- Dockerfile + Compose
- Ngrok for easy development
- Logging
- WebApp setup
- Database setup
goose -dir ./database/migrations/postgres postgres "user=user password=pass dbname=my_db host=localhost port=5437 sslmode=disable" upgoose -s -dir ./database/migrations/postgres create migration_comment sql