Calculator https://github.com/Lexxx42/calculator is now a telegram bot
- Coded with Python 3.11.1
- Создать бота у бота отца https://t.me/BotFather
- Используя команду /newbot или через меню бота-отца
- установить зависимости из файла requirements.txt командой: pip install -r requirements.txt
- создать в корне проекта файл .env
- вставить в .env строку: BOT_TOKEN=ВАШ_ТОКЕН_ТЕЛЕГРАМА, где ВАШ_ТОКЕН_ТЕЛЕГРАМА - токен бота, который получен от бота-отца.
Пример:
BOT_TOKEN=ВАШ_ТОКЕН_ТЕЛЕГРАМА
sudo usermod -a -G docker [user]
newgrp docker
- To run the application in docker, you need to install docker-compose:
sudo apt install docker-compose
- Clone the repository
git clone https://github.com/Lexxx42/calculator_bot_aiogram.git
- Change directory to project dir
cd calculator_bot_aiogram/
- Add your tokens for telegram bot and yandex weather
nano .env
BOT_TOKEN=YOUR_BOT_TOKEN
Don't forget to save changes!
- Start the build
docker-compose up --build
If you are using docker image from DockerHub use following commands:
- To pull repository use:
docker pull alex42konukhov/calculator-bot-aiogram:ubuntu
- Create a container from the image. Should be an error message.
docker run alex42konukhov/calculator-bot-aiogram:ubuntu
- Create
.env
file and add your telegram token
BOT_TOKEN=YOUR_BOT_TOKEN
- Copy the modified configuration file from your host machine to the container's file system:
docker cp .env docker_container_id:/calc-bot/.env
- Run docker container in detached mode
docker start container_id