MA
MasterGroosha/telegram-report-bot
A simple bot to handle reports from users in your chat
Report bot for Telegram
This repository contains source code of a small yet rather powerful bot for Telegram, which handles reports from users and passes them to admins.
Uses aiogram framework.
The main goal is to build a bot with no external database needed. Thus, it may lack some features, but hey, it's open source!
violate group's own rules. If you want to report some content to Telegram official support team, please use "Report"
button in your app.
Screenshot
Features
/reportcommand to gather reports from users;- Reports will be sent to a separate group chat;
/rocommand to set user "read-only";- [optional] Automatically remove "user joined" service messages;
- [optional] Automatically ban channels (since
December 2021
users can write on behalf of their channels); - If message starts with
@adminor@admins, admins are notified; - A simple interface for admins to choose one of actions on reported message;
- Use any locale you want, examples for English and Russian languages are included.
Requirements
- Python 3.11+ (developed under 3.12);
- Systemd (you can use it to enable autostart and autorestart), Docker or anything else you prefer.
Installation
- Go to @BotFather, create a new bot, write down its token, add it to your existing group
and make bot an admin. You also need to give it "Delete messages" permission. - Create a separate group where report messages will be sent and add all group admins there.
Remember: anyone who is in that group may perform actions like "Delete", "Ban" and so on, so be careful. - Use some bot like @my_id_bot to get IDs of these two groups;
- Clone this repo and
cdinto it; - Copy
settings.example.tomltosettings.toml. - Replace default values with your own;
- Now choose installation method: systemd or Docker
systemd
- Create a venv (virtual environment):
python3.12 -m venv venv(or any other Python 3.11+ version); source venv/bin/activate && pip install -r requirements.txt;- Rename
reportbot.service.exampletoreportbot.serviceand move it to/etc/systemd/system; - Open that file and change values for
WorkingDirectory,ExecStartandEnvironmentFileproviding the correct
path values; - Start your bot and enable its autostart:
sudo systemctl enable reportbot.service --now;
6.Check your bot's status and logs:systemctl status reportbot.service.
Docker
- Copy
docker-compose.example.ymlasdocker-compose.yml. - Open it and edit values
- Build and run your container:
docker-compose up -d.
On this page
Languages
Python81.2%Fluent17.4%Dockerfile1.4%
Contributors
MIT License
Created November 20, 2019
Updated March 7, 2026
