小编Ror*_*oro的帖子

在以下位置找不到 <telethon.tl.types.PeerUser 对象的输入实体

我收到错误ValueError:找不到 . 请阅读https://docs.telethon.dev/en/latest/concepts/entities.html以了解更多详细信息。. 此错误来自 client.send_message(bot_id, 'reset')。

def run_test(self,name,bot_id):
        self.start = time.time()
        api_id = 10*****
        api_hash = 'c1*********************************'

        with TelegramClient('anon', api_id, api_hash) as client:
            #breakpoint()
            results = {'results':[], 'start': time.asctime(time.localtime(self.start)), 'conversations': len(self.conversations['tests'])}

            Button(self, text='Cancel', width=20, font=("Lucinda Sans", 12),command=self.cancel(client)).pack()

            statusintro = 'Bot Instance ' + name +': '
            testtitle = ""

            self.show_output(statusintro + testtitle)

            if self.conversationReset is False:
                client.send_message(bot_id, self.conversations['tests'][self.test_counter]['questions'][self.question_counter])
            else:
                print (bot_id)                
                client.send_message(bot_id, 'reset')
                self.conversationReset = False
Run Code Online (Sandbox Code Playgroud)

python-3.x telethon

6
推荐指数
1
解决办法
1606
查看次数

标签 统计

python-3.x ×1

telethon ×1