Step 1: Get API Keys from Telegram
The program requires special access keys from Telegram.
- Open my.telegram.org in your browser
- Enter your phone number with country code (e.g.,
+1234567890) - Important: The confirmation code will arrive in the Telegram app, not via SMS!
- Open Telegram on your phone or computer
- Find the code in the “Service Notifications” chat (looks like
12345) - Enter this code on the website my.telegram.org in the input field
- Click “API development tools”
- Fill in the fields (any values are fine):
- App title:
MyBot - Short name:
MyBot
- Click “Create” or “Save”
- Copy the two values that appear:
- api_id — a number (e.g.,
12345678) - api_hash — a string of letters and numbers (e.g.,
abc123def456...)
Save these values — you’ll need them in the next step.
Step 2: Configure API in config.json File
Now you need to enter the obtained keys into the program.
- Find the
config.jsonfile in the program folder (same folder asTGAutoResponderREGEXP.exe) - Open the
config.jsonfile:
- Right-click on the file
- Select “Open with” → “Notepad” (or Notepad++)
- You will see the following text in the file:
{
"API_ID": 4428373,
"API_HASH": "d4ccb67439cfe30389791b1138e820e0"
}
- Replace the values with yours from Step 1:
- Instead of
4428373(this is an example!) paste your api_id (number) - Instead of
"d4ccb67439cfe30389791b1138e820e0"(this is an example!) paste your api_hash (in quotes!) Example after replacement:
{
"API_ID": 12345678,
"API_HASH": "abc123def4567890123456789abcdef"
}
- Save the file:
- Press Ctrl+S or File → Save
- Close Notepad
⚠️ Important:
API_IDmust be a number without quotesAPI_HASHmust be a string in quotes- Don’t delete commas and curly braces
{ }- Don’t change the names
"API_ID"and"API_HASH"
Step 3: First Telegram Authorization
- Launch the
TGAutoResponderREGEXP.exefile by double-clicking - The main program window will open
- Click the “▶ Start” button at the top of the window
- A “Telegram” dialog will appear — enter your phone number (e.g.,
+1234567890)
- Click OK
- A second dialog will appear — enter the code from Telegram:
- Open the Telegram app on your phone
- Find the code in the “Service Notifications” chat (looks like
12345) - Enter the code in the dialog and click OK
- If you have 2FA password enabled — a third dialog will appear:
- Enter your 2FA password (cloud password from Telegram)
- If you don’t have 2FA — click “Cancel” or leave the field empty
What is a 2FA password?
- 2FA (Two-Factor Authentication) is an additional security layer for your Telegram account
- This is the password you set in Telegram settings (Settings → Privacy → Cloud Password)
- If you didn’t set it up — simply click “Cancel” in the dialog
- Don’t confuse with your Telegram account password — these are different things
- Done! Authorization is complete. A
session.sessionfile will appear in the program folder
⚠️ Important: The
session.sessionfile is access to your account. Don’t share it with others!
Step 4: Setting Up Autoresponder Rules
Now let’s configure which messages to respond to and how.
How Rules Work
The program checks rules from top to bottom in order. As soon as it finds a match — it sends the response and stops checking further.
Examples:
- Regex
price— will trigger if the message contains the word “price” - Regex
.*— will trigger on any message (place such a rule at the bottom of the list)
What is SPINTAX (Variation Messages)?
SPINTAX allows you to create different response variations so they don’t repeat. This reduces the risk of account blocking.
Simple example:
{Hello|Hi|Good day}! {How can I help?|What are you interested in?}
The program will choose a random combination each time:
- “Hello! How can I help?”
- “Hi! What are you interested in?”
- “Good day! How can I help?”
- and so on…
Adding a Rule
- Click the “+ Add” button
- Fill in the fields:
- Enabled: ✓ (checkmark — rule is active)
- Regex: what to search for in the message (e.g.,
priceor.*for all messages) - Template (SPINTAX): response text with variations (e.g.,
{Hello|Hi|Good day}!)
- Click “Preview” — you’ll see how the response will look
- Click “Save” — the rule will appear in the table
Editing a Rule
- Click on the rule in the table (once)
- Click “✏ Edit” or double-click on the rule
- Change the needed fields
- Click “Save”
Deleting a Rule
- Select the rule in the table
- Click “🗑 Delete”
- Confirm deletion
Rule Order Matters!
Rules are checked from top to bottom. The first match triggers, the rest are ignored.
Correct order:
Rule 1: regex "price" → responds to messages with the word "price"
Rule 2: regex ".*" → responds to ALL other messages
Changing Rule Order
Option 1: Drag the rule with the mouse by any part of the row (up/down)
Option 2: Select the rule → click “↑ Up” or “↓ Down”
Enabling/Disabling a Rule
Click on the checkmark ☑/☐ in the “Enabled” column — the rule will activate or deactivate.
Important: Disabled rules don’t work but remain in the list.
SPINTAX Syntax
Main constructs:
{option1|option2|option3}— will choose one random option\n— line break (for multi-line messages)!!text— makes the first letter uppercase
Examples:
{Hello|Hi|Good day}
→ Will choose one option: "Hello" or "Hi" or "Good day"
{Hello|Hi}!\n\nHow are you?
→ "Hello!\n\nHow are you?" (with an empty line between)
{Hello|Good day}, this is a backup account.\n\nClient communication is handled on our main accounts.
→ Will create different greeting variations
Step 5: Launch and Testing
- Set up at least one rule (see Step 4) and make sure it’s enabled (checkmark ☑)
- Click the “▶ Start” button in the top part of the window
- The status should become “Status: Running” (green color) — this means the program is working
- Test it: ask a friend to message you on Telegram
- In the “Logs” section (at the bottom of the window) you will see:
- Who sent the message
- Message text
- What response was sent
- Which rule triggered
🛠 Quick Reference “What Went Wrong?”
| Problem | What to do |
|---|---|
| Code doesn’t arrive | The code arrives in the Telegram chat (inside the app), not via SMS. Check your phone. |
| Program closes | Check config.json. Most likely, you deleted an extra quote or comma. |
| Doesn’t respond to messages | 1. Check if the checkmark in the “Enabled” column is checked. 2. Check if the “Start” button is pressed. |
| Want to change account | Simply delete the session.session file and launch the program again. |
| Session invalid | Delete the session.session file and launch the program again — it will automatically request authorization when you press “Start”. |
| API_ID or API_HASH not specified | Open the config.json file in Notepad, check that API_ID is a number without quotes, and API_HASH is a string in quotes. Make sure you entered your data from my.telegram.org, not the examples |
| Authorization dialog in wrong language | Check the selected language in the dropdown list in the top right corner (the desired language should be selected) |
Tip: Always use the “Preview” button to make sure your text with brackets { | } looks correct and doesn’t contain errors.
