Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phone verification error occurs #51

Open
v4rchaem opened this issue Dec 3, 2021 · 21 comments
Open

Phone verification error occurs #51

v4rchaem opened this issue Dec 3, 2021 · 21 comments

Comments

@v4rchaem
Copy link

v4rchaem commented Dec 3, 2021

phone number: +821012341234
*** 1638365853.511603 Notification API_64BIT_LOGIN_APP_OUTDATED_153: You are using an outdated app that is no longer supported. To access your messages, please update your app to the latest version.
*** 1638365853.512399 Incorrect phone number

please help to solve issue

@GeoIH
Copy link

GeoIH commented Dec 4, 2021

Hey, v4rchaem, could you solve it?

@v4rchaem
Copy link
Author

v4rchaem commented Dec 4, 2021

no, the problem continue

@GeoIH
Copy link

GeoIH commented Dec 4, 2021

holy craps please @kenorb help us¡¡¡

@ulrickno94
Copy link

Damn, got the same error.

@andrew-phi
Copy link

Tg devs updated the protocol, even if you get tgcli running, it won't reveive any messages. This is a server-side issue and the client needs to be rewriteen.

@burkass
Copy link

burkass commented Dec 4, 2021

@andrew-phi yes correct, currently my bot using cli not working. But no issue when sending message. And it looks like login with cli will not working. Make sure session not gone because it might be we can't login wit it anymore.

@sijumanuel
Copy link

same issue

@juliobm
Copy link

juliobm commented Dec 4, 2021

same here

@abitmore
Copy link

abitmore commented Dec 4, 2021

FWIW error messages when running telegram-cli -vvvv:

phone number: +xxxxxx
 *** 1638631722.367240 Sent query #7037869656658957312 of size 204 to DC 2
 *** 1638631722.461673 update 0x382dd3e4 (check=0)
 *** 1638631722.461915 Notification API_64BIT_LOGIN_APP_OUTDATED_222: You are using an outdated app that is no longer supported. To access your messages, please update your app to the latest version.
 *** 1638631722.462198 error for query 'send code' #7037869656658957312: #400 UPDATE_APP_TO_LOGIN
 *** 1638631722.462386 Incorrect phone number

@uriid1
Copy link

uriid1 commented Dec 4, 2021

+1
same issue

@abitmore
Copy link

abitmore commented Dec 4, 2021

According to the doc https://core.telegram.org/method/auth.sendCode, our code for login (auth.sendCode#768d5f4d) is on layer (version) 23.

auth.sentCode#efed51d9 phone_registered:Bool phone_code_hash:string send_call_timeout:int is_password:Bool = auth.SentCode;
auth.sentAppCode#e325edcf phone_registered:Bool phone_code_hash:string send_call_timeout:int is_password:Bool = auth.SentCode;
---functions---
auth.sendCode#768d5f4d phone_number:string sms_type:int api_id:int api_hash:string lang_code:string = auth.SentCode;

The latest layer (version) is 133 and it requires 64-bit IDs for User/Chat

auth.sentCode#5e002502 flags:# type:auth.SentCodeType phone_code_hash:string next_type:flags.1?auth.CodeType timeout:flags.2?int = auth.SentCode;
---functions---
auth.sendCode#a677244f phone_number:string api_id:int api_hash:string settings:CodeSettings = auth.SentCode;

An upgrade to the tgl lib is required.

By the way, due to some issues I forgot, the default tgl lib in this repository (https://github.com/kenorb-contrib/tgl) stopped working for me, so I switched to https://github.com/majn/tgl, and now it no longer works either.

@denimjeans
Copy link

Same issue here, I belive we are now forced to use the TDlib.
https://core.telegram.org/tdlib
Hope someone will implement this soon.

@staoran
Copy link

staoran commented Dec 7, 2021

Currently we can use Telethon, it can achieve the same effect.

@burkass
Copy link

burkass commented Dec 7, 2021

@staoran can it store number and Sent that number with stored username?

@staoran
Copy link

staoran commented Dec 7, 2021

@burkass Yes, it is as convenient as CLI. For more details, please see its documentation: https://docs.telethon.dev/en/latest/index.html

@ViktorKravtsov
Copy link

@staoran is there compliled exe-file for using on windows? Or instruction how to do this?

@staoran
Copy link

staoran commented Dec 17, 2021

@ViktorKravtsov It is full platform, it is a python package, you can do anything with python. So you need to write a python script and run this script. For example, the following is my usage:

# -*- coding: utf-8 -*-
import os
import time
from telethon import TelegramClient, events, sync

api_id = [123456789]	#api_id
api_hash = ['xxxxxxxxxxxxxxxxxx']	#api_hash
session_name = api_id[:]
for num in range(len(api_id)):
	session_name[num] = "id_" + str(session_name[num])
	client = TelegramClient(session_name[num], api_id[num], api_hash[num])
	client.start()
	client.send_message("@dogss_bot", '/checkin')	#The first item is the robot ID, and the second item is the text sent 
	client.send_message("@pussr_bot", '/checkin')
	client.send_message("@BaigeiMe_Bot", '/checkin')
#	time.sleep(5)	#Delay for 5 seconds and wait for the robot to respond (usually a second response, but there may be blocking) 
#	client.send_read_acknowledge("@luxiaoxun_bot")	#Set robot response as read 
	print("Done! Session name:", session_name[num])
	
os._exit(0)

@burkass
Copy link

burkass commented Feb 6, 2022

Issue occur again this time after put the code and same error came. Already use -q

image

@zqhong
Copy link

zqhong commented Apr 17, 2022

@staoran

telethon.errors.rpcerrorlist.ChatWriteForbiddenError: You can't write in this chat (caused by SendMessageRequest)

When I send a message to a regular user using telethon, I get an error like the one above.

Can telethon only send messages to bot?

@staoran
Copy link

staoran commented Apr 17, 2022 via email

@zqhong
Copy link

zqhong commented Apr 17, 2022

@staoran

Hi, thanks for your help, now I can send messages to bot and normal users normally.

The related code is as follows. Note that the app_id and api_hash are obtained through the https://my.telegram.org/auth website application.

from telethon.sync import TelegramClient

if __name__ == '__main__':
    api_id = 12345
    api_hash = 'xxx'
    session_name = "session_name"

    client = TelegramClient(session_name, api_id, api_hash)
    client.start()

    client.send_message("@bot_name", '/sign')

    # Note that for this to work the phone number must be in your contacts
    user_id = client.get_peer_id('+34123456789')
    print(user_id)

    client.send_message(user_id, "hello")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests