亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Telethon client.conversation() 不起作用

Telethon client.conversation() 不起作用

人到中年有點甜 2023-10-26 10:41:38
我嘗試使用電視馬拉松與電報機器人進行類似測驗的對話。它應該看起來像:user1 > /startbot > Hello who send you?user1 > user0bot > Thank you. So do you want in channel1 or channel2 or both?user1 > channel1*Bot invites the user我使用了這個例子: https://arabic-telethon.readthedocs.io/en/stable/extra/examples/telegram-client.html#conversations-waiting-for-messages-or-replies 示例代碼:with bot.conversation(chat) as conv:    conv.send_message('Hi!')    hello = conv.get_response()    conv.send_message('Please tell me your name')    name = conv.get_response().raw_text    while not any(x.isalpha() for x in name):        conv.send_message("Your name didn't have any letters! Try again")        name = conv.get_response().raw_text    conv.send_message('Thanks {}!'.format(name))但它不會運行。文檔中寫道,聊天代表一個實體。所以我嘗試了發件人 ID 和用戶名...我的代碼:@bot.on(events.NewMessage(chats=bot.get_entity('Just Another Test Group'),blacklist_chats=True,pattern='/access'))async def access(event):    print("jop")    temp = await event.get_sender()    temp2 = await event.get_chat()    print(temp)    print(temp2.id)    with bot.conversation(temp.id) as conv:        print("started")        event.respond("hmm")        conv.send_message('Hi!')        hello = conv.get_response()        conv.send_message('Please tell me your name')        name = conv.get_response().raw_text        while not any(x.isalpha() for x in name):            conv.send_message("Your name didn't have any letters! Try again")            name = conv.get_response().raw_text        conv.send_message('Thanks {}!'.format(name))
查看完整描述

1 回答

?
幕布斯6054654

TA貢獻1876條經驗 獲得超7個贊

天啊……對不起。這是關于 Telegram Web 的。

當我使用手機或桌面應用程序時,我會完美地重新排列所有內容......

我對此感到抱歉。


查看完整回答
反對 回復 2023-10-26
  • 1 回答
  • 0 關注
  • 167 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號