Answer the question
In order to leave comments, you need to log in
How to add a user to a telegram chat?
Hello everyone, I have a code and there is a function, it collects an audience, just gets their data from the chat. Having received their data, that is, id and username, I want to add the users that I received to the chat, which I will create later. There are 2 codes in the documentation, they are essentially the same:
Первый:
from telethon.sync import TelegramClient
from telethon import functions, types
with TelegramClient(name, api_id, api_hash) as client:
result = client(functions.messages.GetMessagesViewsRequest(
peer='username',
id=[42],
increment=False
))
for x in result:
print(x)
Второй:
await client(GetMessagesViewsRequest(
peer=channel,
id=msg_ids,
increment=True
))
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question