I am using Pyrogram to make userbot. I need to check if user is online and if he is online I will send him a message. I couldn't understand documentation.
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!')
I tried to use pyrogram.types.User
, but I didn't understand what I am doing.