Documentation menu

Telegram Credentials

Telegram Credentials & Session Setup

Step-by-step instructions to obtain Telegram API ID/Hash, create a manager bot with BotFather, and connect Pyrogram user sessions.

Verified against the checkout built for v2.2.4 · updated 20 Oct 2026

Overview

AutoTelegramForward uses a hybrid model:

  • Telegram Bot Token: Powers the interactive inline button UI (/settings, /profile, rule management).
  • User MTProto Sessions: Enables reading and forwarding from private channels, public channels, and groups where external bots are not permitted to join.

Step 1: Obtain API ID & API Hash

  1. Log in to the official Telegram portal at my.telegram.org using your Telegram phone number.
  2. Click on API development tools.
  3. Create a new application by filling in an App title and Short name (e.g., ATF Forwarder).
  4. Copy your api_id (an integer like 12345678) and api_hash (a 32-character hex string).

Step 2: Create Manager Bot with @BotFather

  1. Open Telegram and start a chat with the official @BotFather.
  2. Send the command /newbot.
  3. Choose a friendly display name (e.g., ATF Manager) and a unique username ending in bot.
  4. Copy the HTTP API token provided (e.g. 1234567890:ABCdef...). This is your TELEGRAM_BOT_TOKEN.

Step 3: Discover Your Numerical User ID

Telegram usernames can change, so AutoTelegramForward uses permanent 64-bit numerical IDs for admin authentication.

  1. Message @userinfobot on Telegram.
  2. Note down your numerical Id (e.g. 5094837833).
  3. Assign this to ADMIN_USER_ID in your .env file.

Step 4: Connect MTProto User Sessions

Once the core service is started:

  1. Open your newly created manager bot on Telegram and send /start.
  2. Click on 👤 حساب‌های کاربری (Accounts / Sessions).
  3. Click ➕ افزودن اکانت جدید to connect an account via QR code or phone verification code.
  4. The session is securely stored inside the isolated sessions/ volume.