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

@@ -15,8 +15,8 @@ This can be further improved by also searching for non-ascii characters (e.g.: J
as some user names may not contain ascii letters at all.
"""
client = Client("example")
client.start()
app = Client("my_account")
app.start()
target = "username" # Target channel/supergroup username or id
users = {} # To ensure uniqueness, users will be stored in a dictionary with user_id as key
@@ -31,9 +31,9 @@ for q in queries:
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(q),
offset=offset,
limit=limit,
@@ -60,4 +60,4 @@ for q in queries:
print("Total users: {}".format(len(users)))
client.stop()
app.stop()