Skip to content

flawme/tele-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telegram Username Profile Bot

This bot accepts a Telegram username such as @durov or https://t.me/durov and replies with the profile details Telegram exposes.

This is only for personal project use. Do not use it for bad things.

It uses:

  • the Telegram Bot API directly through Node.js fetch
  • telegram (GramJS) for MTProto username resolution

Why MTProto is used

Telegram's simple Bot API is not enough for arbitrary username resolution. This project uses MTProto with your bot token plus API_ID and API_HASH, so the bot can resolve public usernames and fetch richer profile data.

Setup

  1. Create a bot with @BotFather and copy the bot token.
  2. Create an app at my.telegram.org and copy your API_ID and API_HASH.
  3. Copy .env.example to .env and fill in the values.
  4. Install dependencies:
npm install
  1. Start the bot:
npm start

Usage

Send either of these to the bot:

  • @username
  • https://t.me/username
  • /lookup @username

The bot will reply with the public information Telegram returns for that username. If the username belongs to a public channel or supergroup, the bot will return chat info instead.

Notes

  • Telegram only returns the data your bot is allowed to see.
  • Private usernames, deleted accounts, and restricted entities may return lookup errors.
  • This project uses long polling for simplicity.
  • Licensed under the MIT License.

About

Personal Telegram username lookup bot built with Node.js and MTProto. For personal project use only.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors