Code Monkey home page Code Monkey logo

calculator_bot_aiogram's Introduction

calculator_bot_aiogram

Calculator https://github.com/Lexxx42/calculator is now a telegram bot

  • Coded with Python 3.11.1

used libraries


С чего начать?

  1. Создать бота у бота отца https://t.me/BotFather
  2. Используя команду /newbot или через меню бота-отца
  3. установить зависимости из файла requirements.txt командой: pip install -r requirements.txt
  4. создать в корне проекта файл .env
  5. вставить в .env строку: BOT_TOKEN=ВАШ_ТОКЕН_ТЕЛЕГРАМА, где ВАШ_ТОКЕН_ТЕЛЕГРАМА - токен бота, который получен от бота-отца.

Пример:

BOT_TOKEN=ВАШ_ТОКЕН_ТЕЛЕГРАМА

New features with docker

If there is an error about lack of access, add current user to the docker group:

sudo usermod -a -G docker [user]
newgrp docker

Use this sequence of commands to run the container:

  1. To run the application in docker, you need to install docker-compose:
sudo apt install docker-compose 
  1. Clone the repository
git clone https://github.com/Lexxx42/calculator_bot_aiogram.git
  1. Change directory to project dir
cd calculator_bot_aiogram/
  1. Add your tokens for telegram bot and yandex weather
nano .env
BOT_TOKEN=YOUR_BOT_TOKEN

Don't forget to save changes!

  1. Start the build
docker-compose up --build

Added docker image to public repository

Docker Hub

If you are using docker image from DockerHub use following commands:

  1. To pull repository use:
docker pull alex42konukhov/calculator-bot-aiogram:ubuntu
  1. Create a container from the image. Should be an error message.
docker run alex42konukhov/calculator-bot-aiogram:ubuntu
  1. Create .env file and add your telegram token
BOT_TOKEN=YOUR_BOT_TOKEN 
  1. Copy the modified configuration file from your host machine to the container's file system:
docker cp .env docker_container_id:/calc-bot/.env
  1. Run docker container in detached mode
docker start container_id

calculator_bot_aiogram's People

Contributors

lexxx42 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.