From 67b79b248e4b8781826b628481657d018ecbed85 Mon Sep 17 00:00:00 2001 From: Lonami Date: Sun, 9 Jul 2017 12:47:17 +0200 Subject: [PATCH] Use __call__() instead invoke() --- Joining-a-chat-or-channel.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Joining-a-chat-or-channel.md b/Joining-a-chat-or-channel.md index 41e6845..cff8f07 100644 --- a/Joining-a-chat-or-channel.md +++ b/Joining-a-chat-or-channel.md @@ -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