tdlib / telegram-bot-api

Telegram Bot API server
https://core.telegram.org/bots
Boost Software License 1.0
3.11k stars 593 forks source link

Persistent "ERROR" When Creating Telegram Application #597

Closed McxCZE closed 2 months ago

McxCZE commented 3 months ago

I am experiencing persistent "ERROR" messages when attempting to create a Telegram application via the my.telegram.org site. Despite following various suggested fixes, the problem remains unresolved. Steps to Reproduce:

Fill in the required fields for creating a new application on my.telegram.org. Click the "Create Application" button.

Expected Result:

The application should be created successfully without errors. Actual Result:

An "ERROR" message is displayed, and the application is not created. What I Have Tried:

Python Script for Automation:

import requests
import time
import logging

# Set up logging
logging.basicConfig(filename='telegram_app_creation.log', level=logging.INFO, format='%(asctime)s %(levelname)s %(message)s')

# URL and headers for the request
url = "https://my.telegram.org/apps/create"
headers = {
    'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 Edg/125.0.0.0',
    'Cookie': 'stel_token=MY_STEL_TOKEN',
    'Origin': 'https://my.telegram.org',
    'Referer': 'https://my.telegram.org/apps',
    'Accept': '*/*',
    'Accept-Encoding': 'gzip, deflate, br, zstd',
    'Accept-Language': 'cs,en;q=0.9,en-GB;q=0.8,en-US;q=0.7',
    'X-Requested-With': 'XMLHttpRequest'
}

# Form data
data = {
    'hash': 'MY_HASH',
    'app_title': 'AppTitlev20240906',
    'app_shortname': 'AppShortv20240906',
    'app_url': 'https://my.telegram.org/apps',
    'app_platform': 'web',
    'app_desc': 'Chat Application is designed to help you read groups as quickly as possible. This app leverages the Telegram API, ensuring seamless integration with the Telegram ecosystem.'
}

def send_request():
    response = requests.post(url, headers=headers, data=data, verify=False)
    return response

def worker():
    retries = 3
    for _ in range(retries):
        response = send_request()
        if response.status_code == 200 and "ERROR" not in response.text:
            logging.info("Application created successfully.")
            logging.info(response.text)
            break
        else:
            logging.error("Encountered ERROR, retrying...")
            logging.error(response.text)
            time.sleep(1)  # Wait for 1 second before retrying

num_requests = 50
requests_per_worker = num_requests // 2

for _ in range(2):  # 2 workers
    for _ in range(requests_per_worker):
        worker()

JavaScript Console Script:

    (function retryCreateApp() {
        // Define a function to override the default alert behavior
        window.alert = function(message) {
            if (message === "ERROR") {
                console.log("Error encountered, retrying...");
                // Re-run the createApp function after a brief delay
                setTimeout(createApp, 1000);
            } else {
                // Restore the default alert behavior for other messages
                alertOriginal(message);
            }
        };

        // Save the original alert function to restore it later if needed
        var alertOriginal = window.alert;

        // Function to start the process
        function startCreateApp() {
            createApp();
        }

        // Add an event listener to the button to start the process
        document.getElementById("app_save_btn").addEventListener("click", startCreateApp);
    })();

Tried without VPN: I am from Europe, and I have tried accessing the site with my home IP address and phone number.

Community Suggestions Attempted:

Environment:

Request for Assistance:

I would greatly appreciate any further insights or solutions from the community or developers to resolve this persistent issue.

levlam commented 3 months ago

It looks like you are trying to automatically create application. This makes no practical sense, supposed to fail, and you are supposed to receive "ERROR" as the response.

McxCZE commented 3 months ago

It was a desperate attempt, someone referenced a video that when clicking it automatically sometimes helps, I have tried countless times to do it in different browsers, by hand with no luck, I just get this generic error. There is no details nothing.

obrazek

McxCZE commented 3 months ago

I have basically tried everything there is to try in this thread https://github.com/tdlib/telegram-bot-api/issues/273, and I have noticed that it is closed, but with no solution that would work for me, nothing.

I am using my own phone number, and I am logging in from my own home IP address, in desperation I have tried a VPN, but to no avail, as I have written before

https://github.com/tdlib/telegram-bot-api/issues/273

levlam commented 3 months ago

If you receive an error from your home IP address, then you can only try to register application from some other place.

www222fff commented 3 months ago

same error with me, have you got the fix? @McxCZE

pickfire commented 3 months ago

I tried to manually register an app I get the same error too.

shamp-dev commented 1 week ago

It would seem that telegram developer portal is purposely rejecting applications. are they not accepting new applications?

I create a brand new telegram account with brand new phone number. Still Doesn't work.

annamarchenkova commented 1 week ago

any news on how to solve the issue?

shamp-dev commented 1 week ago

any news on how to solve the issue?

I asked my indian friend to do. Worked Perfect.