This is a basic implementation of long polling Telegram bots.
-
Add your bot credentials to application.yml or dev profiles
telebot: adminUserNames: ## List of usernames with cannot be banned - shevchenco firstBot: name: token: -
Run as SpringBoot servise. NOTE: service is not listening to any port by default.
- Build image with gradle:
./gradlew clean buildImage
- Setup docker-compose environment values or set it in .env file:
services:
bot:
image: bot:latest
container_name: tele-bot
environment:
TELEBOT_FIRSTBOT_TOKEN: ${TELEBOT_FIRSTBOT_TOKEN}
TELEBOT_FIRSTBOT_NAME: ${TELEBOT_FIRSTBOT_NAME}
TELEBOT_FIRSTBOT_REPLYTOUNKNOWNMESSAGES: true
TELEBOT_FIRSTBOT_BANTIMEOUT: 60-600
restart: always
- Start service:
docker-compose up -d --build --force-recreate
