Give it a try: @my_id_bot.
This is a simple bot written with aiogram 3.x framework to show some IDs, like:
- Your user ID (when asked in inline mode or in private chat with any message);
- Group/supergroup ID (when added to that group or with /id command);
- Channel ID (when message forwarded from channel to one-to-one chat with bot);
- Supergroup ID (when message forwarded from anonymous group admin);
- Topic ID for forum supergroups;
- Sticker ID (they can be re-used with any bot);
- Group to supergroup migrate information (both old and new ID).
- Python 3.11 and newer;
- Linux (should work on Windows, but not tested);
- Systemd init system (optional).
- Docker (optional).
- Clone this repo;
cd
to cloned directory and initialize Python virtual environment (venv);- Activate the venv and install all dependencies from
requirements.txt
file; - Copy
env_example
to.env
(with the leading dot), open.env
and edit the variables; - In the activated venv:
python -m bot
- Perform steps 1-4 from "just to test" option above;
- Copy
my-id-bot.example.service
tomy-id-bot.service
(or whatever your prefer), open it and editWorkingDirectory
andExecStart
directives; - Copy (or symlink) that service file to
/etc/systemd/system/
directory; - Enable your service
sudo systemctl enable my-id-bot --now
; - Check that service is running:
systemctcl status my-id-bot
(can be used without root privileges).
- Get
docker-compose.example.yml
file and rename it asdocker-compose.yml
; - Get
env_example
file, rename it as.env
(with the leading dot), open it and edit the variables; - Run the bot:
docker compose up -d
; - Check that container is up and running:
docker compose ps