This telegram bot allows subscribers to create their own posts on your channel; or sent posts to the special moderated channel to confirm it. For now interface is only in russian. Feedback: https://t.me/tolaptik
- Supporting photo, animation and video post types.
- You can add multiple channels.
- You can add multiple administrators.
- Telegram native message text formatting.
- Like and dislike buttons at posts.
- You can set custom daily posts limit for each user and for any channel.
- Rating. +1 point for like and -1 point for dislike.
- Users statistic (rating, posts amount, likes, dislikes amount).
- Copy default_config.py file to config.py
- Now all next changes will be in config.py.
- Create bot and enter your token to TOKEN field. See Telegram Bot Introduction.
TOKEN = "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11"
- Enter database parameters. By default, this bot use PostgresDB.
DB_HOST = "127.0.0.1"
DB_PORT = 5432
DB_NAME = "your_bot_db_name"
DB_USER = "postgres"
DB_PASSWORD = "really_secure_password"
- Optional. Enter your telegram id. You can get it after starting bot by command '/get_id' in the private conversation with bot. Without this field you can't add channels, add new admins and use other admins only commands. By default, SUPER_ADMIN_ID will be saved id DB with username = 'superuser'.
SUPER_ADMIN_ID = 112233445
- Optional. You can set EXCEPTION_LOG_CHAT_ID, then bot will send exceptions text in this chat. It can be your private conversation or special channel.
- Setup configuration and run database.
- Installing requirements. Recommended to use Python Virtual Environment.
pip install -r requirements.txt
- Run bot.
python start.py
- By default, bot use polling. It's not recommended for production. You can set webhooks in config.py. Telegram API require domain with SSL! Only 'https://' links.
WEBHOOK_HOST = '127.0.0.1'
WEBHOOK_PORT = 5000
POLLING_USING = False # disable polling to start aiohttp app.
- Set Nginx redirection to 127.0.0.1:5000. Nginx config example:
server {
listen 443 ssl;
server_name example.com;
location /your_bot_token {
proxy_pass http://127.0.0.1:5000/bot/;
}
}
- Restart Nginx.
sudo systemctl reload nginx
- Go to the BotFather and set domain settings to your bot. See Telegram Bot API -> Webhooks.
Post after sending to the channel.
You can use formatting by right click on pc and long press on phone -> formatting.
Bot can automatically add your first name or username to a post caption.
Admin required. After freezing users can't send new posts to this channel until unfreeze.
Channel will not be displayed while post creating.
Admin required. User can send only 2 posts by default in every channel. You can set own limit for each user.
- English translation
- Moderated channel
- Change default channel daily posts limit.