Midblyte / tmnetbot

A Telegram bot
GNU General Public License v3.0
3 stars 1 forks source link
mongodb-atlas telegram

tmnetbot - share your telegram channel by allowing other people to post into it through a bot

Setup and run

Step 1

First, clone this repository. Type:

git clone https://github.com/Midblyte/tmnetbot

Step 2

Install the dependencies (let the project root be tmnetbot):

cd tmnetbot && pip install -r requirements.txt 

Step 3

Set the needed environment variables. You can also create a .env file at the root of the project and put them into it:

MacOS, Linux:
touch .env
Windows (Powershell):
New-Item ".env"

Step 4

Run the provided script. You'll see a .session file to be created in the folder:

MacOS, Linux:
./bin/start_bot.py
Windows:
python .\bin\start_bot.py

Environment variables

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:

Get them from https://my.telegram.com/apps. Here's how you can get it:

Get it from https://mongodb.com. Here's how you can get it:

Let it be anything you want (optional, defaults to tmnetbot). It is used both as database name and prefix of the session file

The correct format of the .env file is KEY = VALUE. For each variable give it its own line.

Description

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.

Requirements

Limitations

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.

Special thanks

To atsetilam, who agreed to make it open source.

License

Copyright (C) 2020 Midblyte

Licensed under the terms of the GNU General Public License v3 or later (GPLv3+)