Telegram Login Manager is a command-line tool designed to manage Telegram login sessions. It allows you to add, list, and delete Telegram accounts, and stores the session data in a file for future use. This tool supports proxy configurations and error handling.
After adding accounts, you can move the session JSON file to another machine or share it with others. The session file contains the login session information, allowing you to use the same accounts without needing to log in again. You can use it with libraries like gramjs (Node.js), Telethon (Python), and others.
Developed by: @NabiKAZ on Twitter
Channel: @BotSorati on Telegram
- List all accounts: View a list of all Telegram accounts with their details.
- Add a new account: Add a new Telegram account by logging in with your phone number.
- Delete an account: Remove an account from the session file by ID.
- Get last messages: Get the last 3 messages from the most recent private chat.
- Copy session: Generate a new session for an existing account without prompts for use in other apps.
- Session management: Saves Telegram session data for easy future logins.
- Proxy support: Configure SOCKS5 proxy for connections.
To install and use the Telegram Login Manager, follow these steps:
If you don't have Git installed, download and install it from Git Downloads.
Download and install Node.js from the official website: Node.js Downloads. Ensure you download the LTS version.
- On Windows, press
Win + R, typecmd, and hitEnter. - On macOS/Linux, open your terminal.
Once Git and Node.js are installed, clone the repository and navigate to the project directory:
git clone https://github.com/nabikaz/telegram-login-manager.git
cd telegram-login-managerUse npm to install the required dependencies:
npm installThe configuration is stored in the config.mjs file. You need to modify the following parameters:
- apiId: Your Telegram API ID. You can obtain it from https://my.telegram.org.
- apiHash: Your Telegram API Hash. You can obtain it from https://my.telegram.org.
- proxyUrlSocks: If you're using a SOCKS5 proxy, specify the proxy URL in the format
IP:PORT. Example:'127.0.0.1:10808'. If no proxy is required, leave it asnull. - sessionFileName: The file name where the account session data is stored (default is
accounts.json).
The tool supports five main commands:
To list all the stored Telegram accounts:
node tg.mjs listThis will display a table of all stored accounts with their ID, phone number, first name, last name, and username.
To add a new account, run:
node tg.mjs addThe tool will prompt you to enter your phone number, password, and verification code to log in to Telegram.
To delete an account by ID:
node tg.mjs del <id>Replace <id> with the ID of the account you want to delete.
To get the last 3 messages from the most recent private chat:
node tg.mjs messages <id>Replace <id> with the ID of the account you want to retrieve messages for. This command will display the last 3 messages from the most recent private chat of the specified account.
To generate a new session for an existing account:
node tg.mjs copy <id>Replace <id> with the account ID. This command generates a new session string for use in other applications or scripts. It automatically handles verification codes and passwords with minimal user input.
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
If this project has been useful to you and you'd like to support its development, I would greatly appreciate your contribution! Here are a few ways you can help:
-
Give a Star: Show your support by giving a ⭐ at the top of this GitHub repository. It motivates me to keep improving!
-
Donate: If you'd like to contribute financially, you can donate to the following addresses:
- USDT (TRC20):
TEHjxGqu5Y2ExKBWzArBJEmrtzz3mgV5Hb - TON:
UQAzK0qhttfz1kte3auTXGqVeRul0SyFaCZORFyV1WmYlZQjORnabikaz.ton
- USDT (TRC20):
Your support, whether through a star or a donation, helps me continue working on projects like this. Thank you for being a part of this journey! 🚀