Dockerfile for https://github.com/topkecleon/telegram-bot-bash
- Create a Bot using the Botfather
- Copy botconfig.jssh.sample to
botconfig.jssh
- Update this file with the
bottoken
andbotid
provided by Botfather - For good measure, add your Telegram ID as the
botadmin
- Update this file with the
- Create a
botacl
(access control) file to give your Telegram user permissions to interact with the bot. Take a look at botacl.sample to get an understanding of the format of this file.
All the information that you need regarding customising your bot is available in the README files of the telegram-bot-bash repository.
The easiest approach to testing your customisations is to copy the following files into files into your customised Telegram Bot Bash directory:
botacl
botconfig.jssh
Dockerfile
docker-compose.yml
You'll need to update docker-compose.yml
to mount your directories. For example, if you have customisations in ./scripts
:
-
Add the following bindings (consider creating a
docker-compose.override.yml
for these settings)- type: bind source: ./mycommands.sh target: /app/mycommands.sh - type: bind source: ./scripts target: /app/scripts
docker-compose up -d
Visit your bot in Telegram and start a chat with the /start
command.
ENJOY!
You could always build your own Docker image for use in your projects.
You'll need to substitute your own username in place of my username (dcoomber
).
docker build --tag dcoomber/telegram-bot-bash:1.52 --tag dcoomber/telegram-bot-bash:latest .
docker push dcoomber/telegram-bot-bash --all-tags