Penguin3007 / TelegramApiVue

SDK Telegram Api for VueJs
GNU General Public License v3.0
10 stars 3 forks source link

Getting some erros (NETWORK_BAD_REQUEST) #2

Open buclefor opened 4 years ago

buclefor commented 4 years ago

Hello, my code is similar to the getting started guide.

    telegramInit(phoneNumber) {
      var self = this;
      telegramApi.getUserInfo()
        .then((user) => {
          if (user.id) {
            console.log("Telegram User: ");
            console.dir(user);
          } else {
            self.telegramSendCode(phoneNumber);
          }
        }).catch((error)=>{
          console.dir(error);
        });
    },
    telegramSendCode(phoneNumber) {
      telegramApi.sendCode(phoneNumber).then((response) => {
        if (!response.phone_registered) {
          console.log("Telegram Phone Registered: " + response.phone_registered);
        }
        console.log("Telegram Phone Hash: " + response.phone_code_hash);
      }).catch((error)=>{
        console.dir(error);
      })
    }

I filled the settings with my own telegram data but I'm getting several errors:

telegramApi.min.js:6 [0.217] now master instance 
{id: 4232854409, idle: false, time: 1600854228825}
telegramApi.min.js:6 [0.230] Api call help.getNearestDc
telegramApi.min.js:6 [0.287] Api call auth.sendCode
telegramApi.min.js:6 [1.211] Rpc response nearestDc
telegramApi.min.js:6 [1.212] Rpc error 
{code: 303, type: "PHONE_MIGRATE_4", description: "CODE#303 PHONE_MIGRATE_4", originalError: {…}}
telegramApi.min.js:6 [1.234] Error 303 PHONE_MIGRATE_4 false 2
telegramApi.min.js:6 [1.326] Api call auth.sendCode
telegramApi.min.js:5 POST http://localhost:8080/false 404 (Not Found)
telegramApi.min.js:6 Encrypted request failed 
{code: 406, type: "NETWORK_BAD_REQUEST", url: false, originalError: {…}}
telegramApi.min.js:6 [1.378] Check connection undefined
telegramApi.min.js:5 POST http://localhost:8080/false 404 (Not Found)
telegramApi.min.js:6 [1.405] Delay  1500
telegramApi.min.js:6 [2.910] Check connection undefined
telegramApi.min.js:5 POST http://localhost:8080/false 404 (Not Found)
telegramApi.min.js:6 [2.923] Delay  2250
telegramApi.min.js:6 [5.183] Check connection undefined
telegramApi.min.js:5 POST http://localhost:8080/false 404 (Not Found)
telegramApi.min.js:6 [5.193] Delay  3375
telegramApi.min.js:6 [8.578] Check connection undefined

On one hand I get a "PHONE_MIGRATE_4" error. By other hand I get a "NETWORK_BAD_REQUEST" error. It sounds like the library can't use a correct URL (it is using http://localhost:8080/false).

I don't know what I'm doing wrong.

Penguin3007 commented 3 years ago

@buclefor Hi there! Try to install latest version 1.2.8 from npm and check one more time!

Sorry for 1 non support year!