Skip to content

dmitryzakharov1/pihole_telegram_bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Maintenance Python

pihole_telegram_bot

This is a simple statistics bot. Bot launched at Raspberry Pi 2B.

Getting Started

Just clone repo. Install systemd unit.

Prerequisites

You need:

  • Raspberry Pi
  • Python 2 or 3 installed
  • GIT
  • Created telegram bot with TOKEN (get it on @BotFather)
  • Installed requirements.txt
  • local tor socks5 proxy. Proxy needs if you cannot ping to api.telegram.org
pip install -r requirements.txt --no-index

Installing

I use /opt directory to store binary and other stuff. Clone repo.

sudo su
mkdir /opt/
cd /opt
git clone https://github.com/dmitryzakharov1/pihole_telegram_bot.git

Install systemd unit

cd pihole_telegram_bot
cp parabot_service.service /lib/systemd/system

Update parabot.py with you telegram bot token and IP-adresses of Raspberry Pi. INFO: I use local tor node as socks5 proxy. If you no need proxy. Just comment/uncomment updater = Updater(.... line

    REQUEST_KWARGS={
    'proxy_url': 'socks5://127.0.0.1:9100',
#    'urllib3_proxy_kwargs': {
#        'username': 'telebot',
#        'password': 'ksdafjlk3wart',
#    }
    }

    updater = Updater("TOKEN", request_kwargs=REQUEST_KWARGS)
    #updater = Updater("TOKEN")

Check how it works

Start dialog with parabot Type /systat and get answer

Built With

  • nano - GNU text editor

License

This project is not licenced. Do all what you won.

Special thanks

python-telegram-bot and PiHole-api

Releases

No releases published

Packages

No packages published

Languages