banned_users = set()
@dp.message_handler(user_id=banned_users)
async def handle_banned(msg: Message):
print(f"{msg.from_user.full_name} ")
return True
@dp.message_handler()
async def handle_all(msg: Message):
await msg.reply(f"Добрый день, {msg.from_user.full_name} :)")
@dp.message_handler(commands=['ban'], user_id=12312312312312) #свой ID
async def handle_ban_command(msg: Message):
# проверка ID
try:
abuser_id = int(msg.get_args())
except (ValueError, TypeError):
return await msg.reply("ID пользователя.")
banned_users.add(abuser_id)
await msg.reply(f"Пользователь {abuser_id} заблокирован.")