From 66889721c287ed681ec3b4ba8a37a20e503c6887 Mon Sep 17 00:00:00 2001 From: Verum Date: Wed, 25 Feb 2026 17:48:35 +0700 Subject: [PATCH] =?UTF-8?q?=D0=9C=D0=BE=D0=B4=D1=83=D0=BB=D1=8C=20=D1=83?= =?UTF-8?q?=D1=81=D1=82=D0=B0=D0=BD=D0=BE=D0=B2=D0=BA=D0=B8=20=D0=B8=D0=BC?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=20=D0=B1=D0=BE=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bot/handlers/commands/settings/set_name_cmd.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bot/handlers/commands/settings/set_name_cmd.py b/bot/handlers/commands/settings/set_name_cmd.py index 1cb5b99..46fd3cb 100644 --- a/bot/handlers/commands/settings/set_name_cmd.py +++ b/bot/handlers/commands/settings/set_name_cmd.py @@ -6,8 +6,8 @@ from aiogram.fsm.state import StatesGroup, State from aiogram.types import Message, CallbackQuery from aiogram.utils.i18n import gettext as _ +from bot.filters import IsSuperAdmin from bot.core.bots import BotInfo -from bot.filters import IsOwner from bot.handlers.commands.settings.settings_cmd import settings_keyboard from bot.templates import msg from configs import COMMANDS @@ -98,9 +98,9 @@ async def handle_set_name( ) -@router.callback_query(F.data.lower() == CMD, IsOwner()) -@router.message(Command(*COMMANDS[CMD], prefix=BotInfo.prefix, ignore_case=True), IsOwner()) -async def settings_cmd( +@router.callback_query(F.data.lower() == CMD, IsSuperAdmin()) +@router.message(Command(*COMMANDS[CMD], prefix=BotInfo.prefix, ignore_case=True), IsSuperAdmin()) +async def set_name_cmd( message: Message | CallbackQuery, state: FSMContext, bot: Bot, @@ -143,7 +143,7 @@ async def settings_cmd( await state.set_state(SetNameForm.new_name) -@router.message(SetNameForm.new_name, IsOwner()) +@router.message(SetNameForm.new_name, IsSuperAdmin()) async def process_new_name(message: Message, state: FSMContext, bot: Bot): """ Обработка ввода нового имени через FSM @@ -155,3 +155,4 @@ async def process_new_name(message: Message, state: FSMContext, bot: Bot): return await handle_set_name(new_name, message, state, bot) + BotInfo.first_name = new_name