DeadUnicorn
DeadUnicorn

Reputation: 185

How properly use functions in pyrogram?

Sometimes when I use functions in pyrogram I receive the following output:

{
    "_": functionName,
    "argName" : value,
    "arg2Name" : value2,
    # etc.
}

For instance, If I write:

functions.users.GetFullUser(types.InputUserSelf())

I receive:

{
    "_": "functions.users.GetFullUser",
    "id": {
        "_": "types.InputUserSelf"
    }
}

Why do I receive this result? How should I properly use the functions?

Upvotes: 0

Views: 1944

Answers (2)

Ali Abdi
Ali Abdi

Reputation: 427

Client.send() method is now deprecated (Pyrogram v2.0), you should use Client.invoke().

Upvotes: 1

purya nms
purya nms

Reputation: 48

You should use send():

from pyrogram import Client
from pyrogram.api import functions

app = Client("test")
result = app.send(functions.users.GetFullUser(types.InputUserSelf()))
print(result)

Upvotes: 2

Related Questions