generated from FOSS/Bot-Template
style: reformat imports, whitespace and line breaks across project
This commit is contained in:
@@ -22,33 +22,20 @@ SERVICE_LOG_FILES = (
|
||||
|
||||
|
||||
# Кнопка админского меню
|
||||
@router.message(F.text == 'Админ-меню')
|
||||
async def admin_button_inline(message: Message, bot: Bot, state: FSM, arSession: ARS, User: UserModel):
|
||||
@router.message(F.text == "Админ-меню")
|
||||
async def admin_button_inline(
|
||||
message: Message, bot: Bot, state: FSM, arSession: ARS, User: UserModel
|
||||
):
|
||||
await state.clear()
|
||||
|
||||
await message.answer(
|
||||
"Инлайн-клавиатура админа",
|
||||
reply_markup=admin_finl()
|
||||
)
|
||||
|
||||
|
||||
# Колбэк для демо-действия админа
|
||||
@router.callback_query(F.data == 'admin_inline_x')
|
||||
async def admin_callback_inline_x(call: CallbackQuery, bot: Bot, state: FSM, arSession: ARS, User: UserModel):
|
||||
await call.answer("Админское действие выполнено")
|
||||
|
||||
|
||||
# Колбэк с параметром из админской кнопки
|
||||
@router.callback_query(F.data.startswith('admin_inline:'))
|
||||
async def admin_callback_inline(call: CallbackQuery, bot: Bot, state: FSM, arSession: ARS, User: UserModel):
|
||||
get_data = call.data.split(":")[1]
|
||||
|
||||
await call.answer(f"Выбран админский раздел: {get_data}", True)
|
||||
await message.answer("Инлайн-клавиатура админа", reply_markup=admin_finl())
|
||||
|
||||
|
||||
# Отправка файла базы админам
|
||||
@router.message(Command(commands=['db', 'database']))
|
||||
async def admin_database(message: Message, bot: Bot, state: FSM, arSession: ARS, User: UserModel):
|
||||
@router.message(Command(commands=["db", "database"]))
|
||||
async def admin_database(
|
||||
message: Message, bot: Bot, state: FSM, arSession: ARS, User: UserModel
|
||||
):
|
||||
await state.clear()
|
||||
|
||||
if not BOT_DATABASE_EXPORT:
|
||||
@@ -66,8 +53,10 @@ async def admin_database(message: Message, bot: Bot, state: FSM, arSession: ARS,
|
||||
|
||||
|
||||
# Отправка логов админам
|
||||
@router.message(Command(commands=['log', 'logs']))
|
||||
async def admin_log(message: Message, bot: Bot, state: FSM, arSession: ARS, User: UserModel):
|
||||
@router.message(Command(commands=["log", "logs"]))
|
||||
async def admin_log(
|
||||
message: Message, bot: Bot, state: FSM, arSession: ARS, User: UserModel
|
||||
):
|
||||
await state.clear()
|
||||
|
||||
log_files = []
|
||||
@@ -95,8 +84,12 @@ async def admin_log(message: Message, bot: Bot, state: FSM, arSession: ARS, User
|
||||
|
||||
|
||||
# Очистка файлов логов
|
||||
@router.message(Command(commands=['clear_log', 'clear_logs', 'log_clear', 'logs_clear']))
|
||||
async def admin_logs_clear(message: Message, bot: Bot, state: FSM, arSession: ARS, User: UserModel):
|
||||
@router.message(
|
||||
Command(commands=["clear_log", "clear_logs", "log_clear", "logs_clear"])
|
||||
)
|
||||
async def admin_logs_clear(
|
||||
message: Message, bot: Bot, state: FSM, arSession: ARS, User: UserModel
|
||||
):
|
||||
await state.clear()
|
||||
|
||||
log_files = [Path(PATH_LOGS), *SERVICE_LOG_FILES]
|
||||
|
||||
Reference in New Issue
Block a user