mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-25 02:43:45 +03:00
Use __call__() instead invoke()
parent
729017aa4a
commit
67b79b248e
|
@ -6,11 +6,11 @@ Once you have the [entity](Retrieving-an-entity) of the channel you want to join
|
|||
|
||||
```python
|
||||
from telethon.tl.functions.channels import JoinChannelRequest
|
||||
client.invoke(JoinChannelRequest(channel))
|
||||
client(JoinChannelRequest(channel))
|
||||
|
||||
# In the same way, you can also leave such channel
|
||||
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).
|
||||
|
@ -21,7 +21,7 @@ If all you have is a link like this one: `https://t.me/joinchat/AAAAAFFszQPyPEZ7
|
|||
|
||||
```python
|
||||
from telethon.tl.functions.messages import ImportChatInviteRequest
|
||||
updates = client.invoke(ImportChatInviteRequest('AAAAAEHbEkejzxUjAUCfYg'))
|
||||
updates = client(ImportChatInviteRequest('AAAAAEHbEkejzxUjAUCfYg'))
|
||||
```
|
||||
|
||||
## 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
|
||||
from telethon.tl.functions.messages import AddChatUserRequest
|
||||
|
||||
client.invoke(AddChatUserRequest(
|
||||
client(AddChatUserRequest(
|
||||
chat_id,
|
||||
user_to_add,
|
||||
fwd_limit=10 # allow the user to see the 10 last messages
|
||||
|
|
Loading…
Reference in New Issue
Block a user