Use __call__() instead invoke()

Lonami 2017-07-09 12:47:17 +02:00
parent 729017aa4a
commit 67b79b248e

@ -6,11 +6,11 @@ Once you have the [entity](Retrieving-an-entity) of the channel you want to join
```python ```python
from telethon.tl.functions.channels import JoinChannelRequest from telethon.tl.functions.channels import JoinChannelRequest
client.invoke(JoinChannelRequest(channel)) client(JoinChannelRequest(channel))
# In the same way, you can also leave such channel # In the same way, you can also leave such channel
from telethon.tl.functions.channels import LeaveChannelRequest from telethon.tl.functions.channels import LeaveChannelRequest
client.invoke(LeaveChannelRequest(input_channel)) client(LeaveChannelRequest(input_channel))
``` ```
For more on channels, check the [`channels` namespace](https://lonamiwebs.github.io/Telethon/methods/channels/index.html). For more on channels, check the [`channels` namespace](https://lonamiwebs.github.io/Telethon/methods/channels/index.html).
@ -21,7 +21,7 @@ If all you have is a link like this one: `https://t.me/joinchat/AAAAAFFszQPyPEZ7
```python ```python
from telethon.tl.functions.messages import ImportChatInviteRequest from telethon.tl.functions.messages import ImportChatInviteRequest
updates = client.invoke(ImportChatInviteRequest('AAAAAEHbEkejzxUjAUCfYg')) updates = client(ImportChatInviteRequest('AAAAAEHbEkejzxUjAUCfYg'))
``` ```
## Adding someone else to such chat or channel ## Adding someone else to such chat or channel
@ -31,7 +31,7 @@ If you don't want to add yourself, maybe because you're already in, you can alwa
```python ```python
from telethon.tl.functions.messages import AddChatUserRequest from telethon.tl.functions.messages import AddChatUserRequest
client.invoke(AddChatUserRequest( client(AddChatUserRequest(
chat_id, chat_id,
user_to_add, user_to_add,
fwd_limit=10 # allow the user to see the 10 last messages fwd_limit=10 # allow the user to see the 10 last messages