with app:
members_name = ""
for member in app.iter_chat_members(chat_id):
if member.user.username is not None:
members_name += "@" + member.user.username + " "
else:
members_name += member.user.mention + " "
print(members_name)