GithubHelp home page GithubHelp logo

tgmyhomescanbot's Introduction

Бот для сканирования на домашнем сканере в телеграм. Бот работает на linux системах с установленной scanimage

Установка

  1. Получить API ID и API HASH

    1. Авторизайтесь в любом телеграм клиенте
    2. Войдите на сайте https://my.telegram.org.
    3. Перейдите на 'API development tools' и заполните поля
    4. Получите api_id и api_hash
  2. Создайте телеграм бота

    1. Найдите в телеграм бота @BotFather
    2. Введите команду /newbot, создайте бота следую инструкции
    3. Получите TOKEN
  3. Скачайте исходники в папку /srv/http/TGMyHomeScanBot/src

  4. Создайте python venv

     cd /srv/http/TGMyHomeScanBot && python -m venv .
    
  5. Установите зависимости

     /srv/http/TGMyHomeScanBot/bin/python -m pip install -r src/requirements.txt
    
  6. Скопируйте tg_my_home_scan_bot.service в /etc/systemd/system

     cp /srv/http/TGMyHomeScanBot/src/tg_my_home_scan_bot.service /etc/systemd/system
    
  7. Создайте фаил config

     # APP API ID полученный от телеграм
     TG_APP_ID = 000000 
     # APP API HASH полученный от телеграм
     TG_API_HASH = 'HASH'
     # Токен полученный от @BotFather
     TG_BOT_API_TOKEN = 'Токен'
     # Любая строка
     TG_APP_TITLE = 'MyHomeScan'
     # Поле device нужного принтера из ответа scanimage --list-devices
     SCANNER = 'epson2:net:192.168.1.3'
     # Список ID которым разрешён доступ к боту через запятую
     ALLOW_IDS = frozenset([1,2,3])
    
  8. Запустите бота

     sudo systemctl start tg_my_home_scan_bot
    

tgmyhomescanbot's People

Contributors

xalexo avatar

Stargazers

 avatar

Watchers

 avatar  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.