I need to get list of group admins and check message.from_user.id in that list
@router3.message(Command('ban'))
async def ban_command(message: Message):
admins = await bot.get_chat_administrators(chat_id=message.chat.id)
if message.from_user.id in admins:
await bot.ban_chat_member(user_id=message.reply_to_message.from_user.id)
else:
await message.answer("нет прав")
it’s does not work, and all time i have else answer
what’s methods can i use to do it?
New contributor
Евгений is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.