This is a bot for telegram channel suggestions wrote on Python3. The main goal of the bot is to provide one-sided communication between users and administrators of the channel. It support additional features like a anti-spam, user banning, logging, and automatic free proxy collecting. Current version of bot is synchronous and single threaded.
Use the package manager pip3 to install foobar.
pip3 install pyTelegramBotAPI
pip3 install SQLAlchemy
pip3 install loguru
# for proxy support
pip3 install aiohttp
pip3 install proxybroker
- Get bot token from BotFather
- In BotFather write /setjoingroups and select Enable
- Create private channel and add bot as administrator
- Init bot database(SQLite3): in bot root directory execute:
$ python3 ./bot_orm/orm_model.py
- Open config.py and paste your token from BotFather to TOKEN
TOKEN = '123456789:FORE_EXAMPLE_hqzNIrx6hXTG5pMmCx00uh3w'
Now you need to get your channel id. Bot will send all from users to it.
6. In bot directory execute:
$ python3 ./run.py
- In your telegram channel write command < /init > , if all ok bot send id of your channel. For example: "Admin channel ID: -1234567890"
- Open config.py and paste the channel id to OUT_CHANEL_ID
OUT_CHANEL_ID = -1234567890
- Restart bot by execute:
$ python3 ./run.py
In case of no errors bot will redirect content (images, gifs, links) to your channel.
To enable working through proxy in run.py call main() like that:
if __name__ == '__main__':
while True:
logger.info('Starting new iteration of main')
try:
main(use_proxy=True, refresh_proxy_list=True)
except Exception as e:
logger.critical(repr(e))
- Multiprocessing
- Caching with Redis
- Duplicated content recognition with ML
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.