# Get first 200 recent members
app.get_chat_members(chat_id)
# Get all administrators
app.get_chat_members(chat_id, filter="administrators")
# Get all bots
app.get_chat_members(chat_id, filter="bots")
for chatMem in bot.get_chat_members(chat_id):
bot.send_message(message.chat.id, chatMem.user.username)
bot.send_message(bot.chat.get_members(),'Вот они')
@bot.on_message(filters.command('start', 'tag', 'all'))
def start(bot, msg):
for chatMem in app.get_chat_members(chat_id):
bot.send_message(message.chat.id, chatMem.user.username)
bot.run()
textSend = ""
for chatMem in app.get_chat_members(msg.chat.id):
textSend += chatMem.user.username + "\n"
bot.send_message(msg.chat.id, textSend)
from pyrogram import Client, filters
bot = Client('huyapin_bot')
# Get first 200 recent members
@bot.on_message(filters.command('start', 'tag', 'all'))
def start(bot, msg):
for chatMem in bot.get_chat_members():
bot.send_message(msg.chat.id, chatMem.user.username)
bot.run()
filters.command(['start', 'tag', 'all']
bot.get_chat_members(msg.chat.id)
from pyrogram import Client, filters
bot = Client(<<session_name>>, <<api_id>>, <<api_hash>>)
@bot.on_message(filters.command(['start', 'tag', 'all']))
def start(bot, msg):
for chatMem in bot.get_chat_members(msg.chat.id):
bot.send_message(msg.chat.id, chatMem.user.username)
bot.run()
from pyrogram import Client, filters
bot = Client(<<session_name>>, <<api_id>>, <<api_hash>>)
@bot.on_message(filters.command(['start', 'tag', 'all']))
def start(bot, msg):
strMsg = ""
for chatMem in bot.get_chat_members(msg.chat.id):
print(chatMem.user)
strMsg += "id=" + str(chatMem.user.id) + " - "
if chatMem.user.first_name is not None: strMsg += chatMem.user.first_name + " "
if chatMem.user.last_name is not None: strMsg += chatMem.user.last_name + " "
if chatMem.user.username is not None: strMsg += "@" + chatMem.user.username + " "
strMsg += "\n\n"
bot.send_message(msg.chat.id, strMsg)
bot.run()