2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-31 22:35:36 +00:00

Update examples

This commit is contained in:
Dan
2018-04-14 18:46:54 +02:00
parent 4965e0b4f8
commit b5a78ed1d4
13 changed files with 80 additions and 248 deletions

View File

@@ -4,8 +4,8 @@ from pyrogram import Client
from pyrogram.api import functions, types
from pyrogram.api.errors import FloodWait
client = Client("example")
client.start()
app = Client("my_account")
app.start()
target = "username" # Target channel/supergroup
users = [] # List that will contain all the users of the target chat
@@ -14,9 +14,9 @@ offset = 0 # Offset starts at 0
while True:
try:
participants = client.send(
participants = app.send(
functions.channels.GetParticipants(
channel=client.resolve_peer(target),
channel=app.resolve_peer(target),
filter=types.ChannelParticipantsSearch(""), # Filter by empty string (search for all)
offset=offset,
limit=limit,
@@ -35,6 +35,6 @@ while True:
users.extend(participants.users)
offset += limit
client.stop()
app.stop()
# Now the "users" list contains all the members of the target chat