【发布时间】:2021-03-20 15:33:46
【问题描述】:
我目前有代码可以向我的朋友发送消息
但我怎么知道他是否回复
这是我当前的代码
请看注释行
from telethon import TelegramClient
api_id = '1234567'
api_hash = 'MYHASH'
client = TelegramClient('session', api_id, api_hash)
client.start(phone_number)
destination_user_username='friend'
entity=client.get_entity(destination_user_username)
client.send_message(entity=entity,message="hello")
#if he reply hi
client.send_message(entity=entity,message="have a nice day")
我该怎么做?
【问题讨论】:
-
您能否为您的问题提供更多背景信息?你的“客户”是什么?提供足够的上下文以使某人可以获取您编写的内容并至少自行运行其中的一部分以尝试提供解决方案,这通常会帮助您更快地获得答案。
-
我编辑它请帮助我
-
是的,它是一个包
-
那么在您将
python telethon telegram reply放入搜索引擎并查看the example code on GitHub that comes up near the top 之后发生了什么?我假设您尝试基于此编写一些代码,或者甚至可能只是按原样使用该项目(根据其自述文件),但我在您的问题中没有看到任何相关内容。