【发布时间】:2022-12-15 06:22:47
【问题描述】:
我正在使用 Pyrogram 制作用户机器人。我需要检查用户是否在线,如果他在线我会给他发消息。我无法理解文档。
from pyrogram import Client
app = Client(
"my_account",
api_id= 111111111,
api_hash='bbbbbbbbbbbbbbbbb'
)
chat_id = 777777777
with app:
peer = app.resolve_peer(chat_id)
if(is_user_online(chat_id)):
app.send_message(chat_id=chat_id, text='Hello!')
我尝试使用pyrogram.types.User,但我不明白我在做什么。
【问题讨论】: