بــــــــــاســـــــــــم الآب والابــــــــــن والـــــــــــرّوح الــــــــــقــــــــــدـس
Telegram 4chan breaking news notification bot
Currently running at @polbrknws_bot.
- Grabs the 4chan API file for a board (default
/pol/
) - Filters threads already notified
- Filters threads whose title contains certain words (default:
edition
andthread
) - Checks if the thread has at least
5.0
replies per minute (default) and at least150
total replies (default), if no, stops, if yes, ... - ...formats the thread into a message that looks like this:
11.3/min (613r in 54min)
content
...
of
...
the
...
thread
(from United States)
http://boards.4chan.org/pol/thread/12345678
And sends it to all subscribers (including groups/supergroups)!
- You need to be able to run a Python script for as long as the bot should work, so preferably a server or some computer that runs 24/7. You will need to install some packages, such as
telepot
. You can do this viapip install telepot
. - Create a bot with the BotFather (instructions) and get the API token.
- Create a file
api_token
and insert the API token here. - Create a file
admin_id
and insert your personal Telegram ID in there to get additional functionality (logs, list of subscribers, manual broadcast, etc.) You can get this number by- starting the bot
- sending it a message (you get the username from the BotFather)
- checking the
chanogram.log
file and looking for a lineDEBUG - Attempting to handle message from <ID>
.
- Start the script
python3 chanogram.py
orpython3 chanogram.py &
to run as a daemon allowing you to close the terminal again. - Once the bot is running, add it to a group (or open a private chat if you just want to subscribe yourself) as write
/start
.
This bot is based on the great telepot package. Thanks also to the creators of the other Python packages used.