Official site Pi-hole: https://pi-hole.net/
Create Telegram bot BotFather. (If you are not familiar with telegram bots and chat read the docs).
pihole2telegram.py
config.py
kb.py
parse.py
Or clone this repo
git clone https://github.com/Arxdust/pihole2telegram.git
pip3 install -r requirements.txt
or
pip3 install telegram
pip3 install python-telegram-bot
pip3 install request
Insert all YOUR the data in config.py
Example:
#telegram bot TOKEN:
token = 'XXXXXXXX:AAFlHHENXXXXX3mzpyw8H3wWrLVJ7ElMoU'
#User with access (Your telegram ID), if you wont more admins use ['18XXX5XX5', '123456789'] etc.
admin = ['18XXX5XX5']
#URL to pihole api.php
URL = 'http://192.168.88.253/admin/api.php'
#WEBPASSWORD from /etc/pihole/setupVars.conf
WEBPASSWORD = '6e63f2XXX2aadeXXXXcc579eaada89110a8a3aXXXcXXXd1ad99ddXX'
run: pihole2telegram.py
-
Ubuntu 16.0.5
-
Pi-hole v3.3 & 4.0
-
AdminLTE v3.3 & 4.0
-
FTL v3.0 & 4.0
This is my first bot written on python