Telegram BOT boilerplate is a bot with heroku PostgresDB and simple PostgresDB connection and deploying to AWS lambda possibility.
Initialize serverless with the command below:
serverless
Download golang dependencies
go mod download
Create .env file with required attributes:
cp .env.dist .env
cp .env.local.dist .env.local
API_TOKEN - bot token from created bot with BotFather in the Telegram
HEROKU_IS_ACTIVE - configuration for switching between heroku and simple PostgresDB
HEROKU_API_KEY - secret key from Heroku account (on the site: Profile -> Account Settings -> API Key)
HEROKU_POSTGRES_ID - PostgresDB ID
In order to check all addons from heroku and hastily check Postgres ID run command below:
heroku addons
Other information here Heroku PostgreSQL
go run applocal/main.go
At first set up credentials from Identity and Access Management (IAM) user.
export AWS_SECRET_ACCESS_KEY=<your_secret_key>
export AWS_ACCESS_KEY_ID=<your_access_key>
Build application
make build
or immediately deploy it
make deploy