简体   繁体   English

不是有效的 SentCodeType 热解图

[英]is not a valid SentCodeType pyrogram

after I enter the phone number in the console for the pyrogram, the bot user string app.run() pyrogram gives this error:在控制台中输入热图的电话号码后,bot 用户字符串 app.run() 热图给出了这个错误:

Exception has occurred: ValueError <class 'pyrogram.raw.types.auth.sent_code_type_email_code.SentCodeTypeEmailCode'> is not a valid SentCodeType发生异常:ValueError <class 'pyrogram.raw.types.auth.sent_code_type_email_code.SentCodeTypeEmailCode'> 不是有效的 SentCodeType

this was not the case before.以前不是这样。 earlier it doesnt happend and worked god this happens regardless of the code until the app.run() line.早些时候它没有发生并且工作上帝不管代码如何,直到 app.run() 行。 how to fix it?如何解决?

whole code整个代码

from pyrogram  import Client,filters

api_id = my api id
api_hash = my api hash

app = Client(name="my_account",api_id=api_id,api_hash= api_hash)

regions = ("Дніпропетровська_область","Миколаївська_область","Херсонська_область","Запорізька_область","Одеська_область","Київська_область","Вінницька_область","Черкаська_область","Кіровоградська_область","Донецька_область","Харківська_область","Тернопільська_область","Полтавська_область","Львівська_область","ІваноФранківська_область","Чернівецька_область","Рівненська_область","Волинська_область","Житомирська_область","Закарпатська_область","Сумська_область","Чернігівська_область","Хмельницька_область","Луганська_область")

allert = None

@app.on_message(filters.all)
def allert_hendler(client, mess):
    global regions
    global allert
                        
    txt = mess.text
    txt2 = txt.split(" ")
    txt3 = txt2[-1].split("#")
    region = txt3[1]
    time = txt2[1]
    if region in regions:
        if txt2[0] == "🔴":
            allert = ["Тривога",1]
        elif txt2[0] == "🟢":
            allert = ["Відбій", 0]
        elif txt2[0] == "🟡":
            allert = ["частковий відбій",0]

    app.send_message(chat_id=-786324633,text=f"{allert[1]},{region},{time}")

app.run()

I tryed to redownload pyrogram and tgcrypto.我尝试重新下载 pyrogram 和 tgcrypto。 I tryed to change code and keep only part which code need to work, but it happend again我尝试更改代码并仅保留代码需要工作的部分,但它又发生了

In December, additional verification was introduced (due to spam), now core.telegram.org/api/auth#email-verification 12 月,引入了额外的验证(由于垃圾邮件),现在是 core.telegram.org/api/auth#email-verification

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM