tmnetbot - share your telegram channel by allowing other people to post into it through a bot
First, clone this repository. Type:
git clone https://github.com/Midblyte/tmnetbot
Install the dependencies (let the project root be tmnetbot
):
cd tmnetbot && pip install -r requirements.txt
Set the needed environment variables. You can also create a .env file at the root of the project and put them into it:
touch .env
New-Item ".env"
Run the provided script. You'll see a .session file to be created in the folder:
./bin/start_bot.py
python .\bin\start_bot.py
TELEGRAM_CHANNEL
It's the @username (for public channels) or the numeric ID (both for public and private channels). All messages will be forwarded here.
TELEGRAM_BOT_TOKEN
Get it from https://telegram.me/botfather. Here's how you can get it:
Send your bot's username
TELEGRAM_API_ID TELEGRAM_API_HASH
Get them from https://my.telegram.com/apps. Here's how you can get it:
See also: why not just the bot token?
MONGO_URL
Get it from https://mongodb.com. Here's how you can get it:
The connection string will show up. It starts with mongo+srv://
NETWORK_SHORT_NAME
Let it be anything you want (optional, defaults to tmnetbot
).
It is used both as database name and prefix of the session file
KEY = VALUE
. For each variable give it its own line.tmnetbot is a Telegram bot. It allows your users to forward messages from their channel into yours. Useful for Telegram networks which do have a "best posts of the network" channel.
The entire bot has been coded in the the english language as my personal habit. However, since it was initially a private commitment, it has been designed to be used by Italians only. Every text is written in the Italian language, every date is therefore converted in CET/CEST (it depends on DST).
Internationalization is not yet a priority, but any help is welcome.
To atsetilam, who agreed to make it open source.
Copyright (C) 2020 Midblyte
Licensed under the terms of the GNU General Public License v3 or later (GPLv3+)