mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-09-19 02:12:40 +03:00
add one user to one group
This commit is contained in:
parent
ad19987cd6
commit
fce6cfcb59
BIN
.github/.DS_Store
vendored
Normal file
BIN
.github/.DS_Store
vendored
Normal file
Binary file not shown.
33
mass_add.py
Normal file
33
mass_add.py
Normal 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
BIN
readthedocs/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
session_name.session-journal
Normal file
BIN
session_name.session-journal
Normal file
Binary file not shown.
BIN
telethon/.DS_Store
vendored
Normal file
BIN
telethon/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
telethon_generator/.DS_Store
vendored
Normal file
BIN
telethon_generator/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
tests/.DS_Store
vendored
Normal file
BIN
tests/.DS_Store
vendored
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user