- Anonymous submission, support text, image, video and so on
- Reply to user with reason when submission is approved or rejected
- Multi-language, support Chinese, English and Japanese
- Admin can view/ban/unban user
- Admin can view/modify some config in bot
- Anonymous not allowed for forwarded message
- User can feedback with
/feedback
command - Docker support
- Submission statistics
- Submission limit, like word limit, image limit and so on
- Comments in the submission through BOT (very useful when anonymous)
-
What are the roles?
Admin: BOT administrator, can view/modify some config, view/ban/unban user
Approver: approve submission
User: submission with BOT
-
How to add admin?
Before server start, configure in
config.yml
by propertysuper_admins
, multiple admins are separated by commas,
-
How to add approver?
Invite approver to join approval channel, all users who subscribe to the approval channel can approve submission
-
How to set default language?
Configure in
i18n.yml
by propertylangs
, put the default language in the first place
- Apply api_id and api_hash from https://my.telegram.org/apps
- Apply a bot token from @botfather
- Prepare a channel for approval, must be private channel, add bot to channel and grant admin permission
- Prepare a group for approval, must be private group, link to approval channel, add bot to group and grant admin permission
- Prepare a channel for show, add bot to channel and grant admin permission, submission will be forwarded to this channel when approved
- Get channel and group id from @userinfobot
logfile path: appdata/submission_telebot.log
database file path: appdata/submission_telebot.db
When deploying with docker
, you need to install docker
and docker-compose
first
- Download
Dockerfile
、docker-compose.yml
、config.yml
files
wget https://raw.githubusercontent.com/hormones/submission_telebot/main/Dockerfile -O Dockerfile
wget https://raw.githubusercontent.com/hormones/submission_telebot/main/docker-compose.yml -O docker-compose.yml
wget https://raw.githubusercontent.com/hormones/submission_telebot/main/config.yml -O config.yml
- Modify
config.yml
file (or modifydocker-compose.yml
to configure environment variables), please read the comments carefully and fill in the correct configuration - Run
docker-compose up -d
to start the service. The first time you start it, you will pull the image and install the dependencies, which may take a while - Run
docker logs -f --since=3m submission_telebot
to view the log, or runtail -f appdata/submission_telebot.log
to view the log
The first time you run this BOT service, you need to perform steps 1, 2, and 3. After that, you can run directly step 3
- Run the following command on server (install git first, python >= 3.7.3)
git clone https://github.com/hormones/submission_telebot
cd submission_telebot
python3 -m venv venv
source venv/bin/activate
pip install -U pip setuptools
pip install -r requirements.txt
- Modify file
config.yml
or set environment variable, see config file for more detail - Run
source ./venv/bin/activate && nohup python main.py >/dev/null 2>&1 &
to start bot
Users can use /help
、/lang
、/feedback
by default, you can add or delete user commands in user_command
in file config.py
BOT administrators can use all commands by default, can not be modified
Command | Parameter | Default permission | Use range | Description |
---|---|---|---|---|
/help | Optional, command name | All | in BOT | View help, you can enter command parameters to view the corresponding command detailed usage method |
/setting | - | BOT admin | in BOT | View/modify some settings |
/ban | Optional, user ID/username/@username | BOT admin | in BOT | View/ban/unban user |
/lang | - | All | in BOT | Multi-language |
/feedback | Required, feedback content | User | in BOT | Feedback |
/reply | Required, reply content | approval channel members | in approval channel message comments | Reply to user with reason when submission is approved or rejected |
MIT
- When the desktop version submits multiple pictures in one message, if you choose not to compress the picture, it will be sent by Telegram in turn, resulting in the submission being split into multiple messages (there is no problem with compressed pictures, and there is no good solution for the time being)
- If server start failed, please check log file
appdata/submission_telebot.log
first, if you have any question, please submit issue - all config in
config.yml
can be set as environment variable, when there is a corresponding environment variable, it will overwrite the configuration in the configuration file - The English and Japanese translations in this project are translated by Github Copilot plugin, if there is any objection, please submit issue
- If you need to customize the information display, you can study and edit the multi-language configuration in the
i18n.yml
file to better fit the project theme - If you have any other questions or suggestions, please submit issue