@dp.message_handler(commands=['ban'])
async def ban(message: types.Message):
if not message.reply_to_message:
pass
else:
await message.bot.ban_chat_member(message.chat.id, message.reply_to_message.from_user.id)
@dp.message_handler(commands=['ban'])
async def ban(message: types.Message):
try:
await message.bot.ban_chat_member(message.chat.id, message.reply_to_message.from_user.id)
except:
pass