A userbot to scrap your Favourite Telegram chats, groups or channels to your single specific Telegram Chat(Channel/Group also).
This bot is make specifically for one purpose. That is to monitor many Telegram Channels and send to you in one Telegram chat of any form removing hashtags and mentions.
This bot works in various steps as :
- It listens for new posts in your Telegram Channels.
- Tries to clean captions (beta stage).
- Send Caption, Media or both.
- Also, it sends an empty sticker to distinguish between posts.
- You can get Telegram API Codes from Official Telegram API dashboard .
- Send a Message to channel and copy link of that Telegram Channel Post.
- Then your link looks like this :
https://t.me/c/1617181920/369
- Note that long number of 10 digits and add -100 in beginning and it must look like:
-1001617181920
- This is your Channel ID (including
-
sign.)
- Send a Message
/info @ChannelName
to GroupHelpBot and copy link of that Telegram Channel Post.
Note : For pivate chats with no username, mention the person in group or send
/info
command from that respective account to GroupHelpBot .
There are some other variables which you need to note about.
- Generate Session String in a file using the code below:
from telethon.sessions import StringSession
api_id = 0000
api_hash = 'sdfghklasaaddadadasd'
with TelegramClient(StringSession(), api_id, api_hash) as client:
session= client.session.save()
print(session)
r = open("new_session_file.session","w")
r.write(session)
r.close()
BOT_API_TOKEN
- Enter Bot API Token which you get from Botfather in Telegram.from_ids
- Enter Channel ID of your Telegram Channel from where you want to watch posts. Can be multiple channels, groups, chats in list form separated by comma.to_id
- Enter a Chat ID of where you'll get all posts/messages.every_post_caption
- Enter a Caption for every posts you sent to Telegram in image. Can be your channel username or some emoji.
Download Python From here :
While installing, tick install path / environment variables whatever is given
- Install required python modules using commands below:
pip install telethon
- Install all above modules using :
pip install -r requirements.txt
- Install Python, PIPs using above methods
- Download all files in this repo.
- Replace variables at the top of
bot.py
file with your ones, removingos.environ.get('name')
commands.
Type any one of the following command on terminal to run bot:
py bot.py
python bot.py
python3 bot.py
Press the button below or at the top of this readme and insert necessary environment variables and you're done.
##Develop on Okteto: Press the button below or at the top of this readme and insert necessary environment variables and you're done.
Distributed Under GPL or MIT License by @PrabeshAryalNP on social or @PrabeshAryal on code sites.