sunriselink / TelegramApi

JavaScript library for using Telegram API
GNU General Public License v3.0
75 stars 25 forks source link

Sign in problem : NETWORK_BAD_REQUEST and 404 (Not Found) error #12

Open HamidVO opened 6 years ago

HamidVO commented 6 years ago

help.getNearestDc works correctly also I call help.getConfig and set ip address like this : production: [ {id: 1, host: '149.154.175.50', port: 443}, {id: 2, host: '149.154.167.51', port: 443}, {id: 3, host: '149.154.175.100', port: 443}, {id: 4, host: '91.108.4.182', port: 443}, {id: 5, host: '91.108.56.165', port: 443} ] but when calling sendCode I receive this error: Rpc error {code: 303, type: "PHONE_MIGRATE_4", description: "CODE#303 PHONE_MIGRATE_4"

POST http://91.108.4.182:443/apiw1 404 (Not Found) Encrypted request failed {code: 406, type: "NETWORK_BAD_REQUEST", url: "http://91.108.4.182:443/apiw1" Check connection undefined

POST http://91.108.4.182:443/apiw1 404 (Not Found) . . . I checked different IP address and also port 80 and 433. IPs above are from help.getConfig How to solve this issue?

Code:

    telegramApi.sendCode('+989142158375').then(function(sent_code) {
        if (!sent_code.phone_registered) {
            // New user
        }

        // phone_code_hash will need to sign in or sign up
        window.phone_code_hash = sent_code.phone_code_hash;
        alert(window.phone_code_hash);

    });
PeterMX commented 6 years ago

hey @HamidVO, do you find the way to change Telegram package name? can you tell me how?

arutherford commented 6 years ago

@HamidVO What ended up being the fix or did you move on?