Giter Club home page Giter Club logo

my-id-bot's Introduction

Bot to get users/chats IDs in Telegram


Demo: @my_id_bot in Telegram.

This is a simple bot written with aiogram 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);
  • Sticker ID (they can be re-used with any bot);
  • Group to supergroup migrate information (both old and new ID).

Requirements:

  • Python 3.7 and above;
  • Linux (should work on Windows, but not tested);
  • Systemd init system (not necessary).
  • Docker (optional, see below).

Installation:

  1. Create a directory for bot: mkdir my-id-bot;
  2. cd my-id-bot && python3 -m venv venv;
  3. Put bot.py file to my-id-bot directory;
  4. source venv/bin/python && pip install -r requirements.txt;
  5. chmod +x bot.py;
  6. BOT_TOKEN=12345:abcxyz ENABLE_STATS=0 ./bot.py

If you want systemd support for autostart and other tasks: open my-id-bot.service file, change relevant options to match yours, enter correct token.
Now copy that file to /etc/systemd/system enable it with systemctl enable my-id-bot.service and run it: systemctl restart my-id-bot.service. Easy!

Alternatively, you can use Docker (experimental):
Build image: docker build -t my-id-bot-image .
Run container: docker run -e BOT_TOKEN=12345:abcxyz -e ENABLE_STATS=0 -v /path/to/logs/on/host:/logs --name my-id-bot -d --rm my-id-bot-image.
Or use Docker Compose as docker-compose up -d.

my-id-bot's People

Contributors

mastergroosha avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.