Template
mirror of
https://github.com/djimboy/djimbo_template_aio3.git
synced 2026-08-25 14:37:43 +00:00
Update
This commit is contained in:
@@ -8,38 +8,32 @@ from aiogram.types import FSInputFile, Message, CallbackQuery
|
||||
from aiogram.utils.media_group import MediaGroupBuilder
|
||||
|
||||
from tgbot.data.config import PATH_DATABASE, PATH_LOGS
|
||||
from tgbot.database.db_users import UserModel
|
||||
from tgbot.keyboards.inline_misc import admin_inl
|
||||
from tgbot.keyboards.reply_misc import admin_rep
|
||||
from tgbot.database.db_users import BaseModel as UserModel
|
||||
from tgbot.keyboards.inline_main import admin_finl
|
||||
from tgbot.utils.const_functions import get_date
|
||||
from tgbot.utils.misc.bot_models import FSM, ARS
|
||||
|
||||
router = Router(name=__name__)
|
||||
|
||||
|
||||
# Кнопка - Admin Inline
|
||||
@router.message(F.text == 'Admin Inline')
|
||||
# Message - Admin button
|
||||
@router.message(F.text == 'Admin button')
|
||||
async def admin_button_inline(message: Message, bot: Bot, state: FSM, arSession: ARS, User: UserModel):
|
||||
await state.clear()
|
||||
|
||||
await message.answer("Click Button - Admin Inline", reply_markup=admin_inl)
|
||||
await message.answer(
|
||||
"Inline admin keyboards",
|
||||
reply_markup=admin_finl()
|
||||
)
|
||||
|
||||
|
||||
# Кнопка - Admin Reply
|
||||
@router.message(F.text == 'Admin Reply')
|
||||
async def admin_button_reply(message: Message, bot: Bot, state: FSM, arSession: ARS, User: UserModel):
|
||||
await state.clear()
|
||||
|
||||
await message.answer("Click Button - Admin Reply", reply_markup=admin_rep)
|
||||
|
||||
|
||||
# Колбэк - Admin X
|
||||
# Callback - Admin X
|
||||
@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(f"Click Admin X")
|
||||
|
||||
|
||||
# Колбэк - Admin
|
||||
# Callback - Admin
|
||||
@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]
|
||||
@@ -47,7 +41,7 @@ async def admin_callback_inline(call: CallbackQuery, bot: Bot, state: FSM, arSes
|
||||
await call.answer(f"Click Admin - {get_data}", True)
|
||||
|
||||
|
||||
# Получение Базы Данных
|
||||
# Get Database file
|
||||
@router.message(Command(commands=['db', 'database']))
|
||||
async def admin_database(message: Message, bot: Bot, state: FSM, arSession: ARS, User: UserModel):
|
||||
await state.clear()
|
||||
@@ -58,7 +52,7 @@ async def admin_database(message: Message, bot: Bot, state: FSM, arSession: ARS,
|
||||
)
|
||||
|
||||
|
||||
# Получение логов
|
||||
# Get Logs file
|
||||
@router.message(Command(commands=['log', 'logs']))
|
||||
async def admin_log(message: Message, bot: Bot, state: FSM, arSession: ARS, User: UserModel):
|
||||
await state.clear()
|
||||
@@ -79,7 +73,7 @@ async def admin_log(message: Message, bot: Bot, state: FSM, arSession: ARS, User
|
||||
await message.answer_media_group(media=media_group.build())
|
||||
|
||||
|
||||
# Очистить логи
|
||||
# Clear logs file
|
||||
@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()
|
||||
|
||||
Reference in New Issue
Block a user