add one user to one group

This commit is contained in:
Josefin Hao 2023-09-19 23:13:33 +02:00
parent ad19987cd6
commit fce6cfcb59
8 changed files with 33 additions and 0 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

BIN
.github/.DS_Store vendored Normal file

Binary file not shown.

33
mass_add.py Normal file
View File

@ -0,0 +1,33 @@
from telethon import TelegramClient, events, sync, utils
from telethon.tl.functions.messages import AddChatUserRequest
api_id = 28660903
api_hash = '2e6d3d05025f5bd74427d140a45bbc47'
client = TelegramClient('session_name', api_id, api_hash)
client.start()
chat_id = 4094437222
user_to_add = 464929491
# print(client.get_me().stringify())
# client.download_profile_photo('me')
# messages = client.get_messages('username')
# messages[0].download_media()
# @client.on(events.NewMessage(pattern='(?i)hi|hello'))
# async def handler(event):
# await event.respond('Hey!')
# await client(AddChatUserRequest(
# chat_id,
# user_to_add,
# fwd_limit=10 # Allow the user to see the 10 last messages
# ))
client(AddChatUserRequest(
chat_id,
user_to_add,
fwd_limit=100 # Allow the user to see the 100 last messages
))

BIN
readthedocs/.DS_Store vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
telethon/.DS_Store vendored Normal file

Binary file not shown.

BIN
telethon_generator/.DS_Store vendored Normal file

Binary file not shown.

BIN
tests/.DS_Store vendored Normal file

Binary file not shown.