D
D
DTPlayer2021-07-30 00:43:04
Python
DTPlayer, 2021-07-30 00:43:04

How to invite users to a private channel via telethon?

Here is a piece of code in the documentation

from telethon.sync import TelegramClient
from telethon import functions, types

with TelegramClient(name, api_id, api_hash) as client:
    result = client(functions.channels.InviteToChannelRequest(
        channel='username',
        users=['username']
    ))
    print(result.stringify())

But I don't understand what value to insert there (I'm new to working with telethon)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question