Answer the question
In order to leave comments, you need to log in
Error when parsing participants in a telegram asynchronously?
parse.py:
from pyrogram import Client
async def user_chat():
app = Client("my_account", api_id=INT, api_hash="STR")
more_users = []
with app:
for member in app.iter_chat_members(INT):
print(member)
id_user = member.user.id
more_users.append(id_user)
username = member.user.first_name
return more_users
@dp.message_handler(content_types="new_chat_members")
async def add_chat_bot(message: types.Message):
bot_id = INT
title_chat = str(message.chat.title)
for user in message.new_chat_members:
if user.id == bot_id:
await parse.user_chat()
for member in app.iter_chat_members(INT):
TypeError: 'async_generator' object is not iterable
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