Template
mirror of
https://github.com/djimboy/djimbo_template_aio3.git
synced 2026-08-28 16:07:43 +00:00
Update
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
# - *- coding: utf- 8 - *-
|
||||
from aiogram import Router, Bot
|
||||
from aiogram.types import Message
|
||||
from aiogram.filters import Command, Text
|
||||
from aiogram.types import Message, CallbackQuery
|
||||
|
||||
from tgbot.keyboards.inline_main import menu_finl
|
||||
from tgbot.keyboards.inline_misc import user_inl
|
||||
@@ -11,7 +12,7 @@ router = Router()
|
||||
|
||||
|
||||
# Кнопка - User Inline
|
||||
@router.message(text="User Inline")
|
||||
@router.message(Text(text="User Inline"))
|
||||
async def user_button_inline(message: Message, bot: Bot, state: FSM, aSession: AS, my_user):
|
||||
await state.clear()
|
||||
|
||||
@@ -19,7 +20,7 @@ async def user_button_inline(message: Message, bot: Bot, state: FSM, aSession: A
|
||||
|
||||
|
||||
# Кнопка - User Reply
|
||||
@router.message(text="User Reply")
|
||||
@router.message(Text(text="User Reply"))
|
||||
async def user_button_reply(message: Message, bot: Bot, state: FSM, aSession: AS, my_user):
|
||||
await state.clear()
|
||||
|
||||
@@ -27,8 +28,22 @@ async def user_button_reply(message: Message, bot: Bot, state: FSM, aSession: AS
|
||||
|
||||
|
||||
# Команда - /inline
|
||||
@router.message(commands="inline")
|
||||
@router.message(Command(commands="inline"))
|
||||
async def user_command_inline(message: Message, bot: Bot, state: FSM, aSession: AS, my_user):
|
||||
await state.clear()
|
||||
|
||||
await message.answer("Click command - /inline", reply_markup=menu_finl(message.from_user.id))
|
||||
|
||||
|
||||
# Колбэк - User X
|
||||
@router.callback_query(Text(text="user_inline_x"))
|
||||
async def user_callback_inline_x(call: CallbackQuery, bot: Bot, state: FSM, aSession: AS, my_user):
|
||||
await call.answer(f"Click User X")
|
||||
|
||||
|
||||
# Колбэк - User
|
||||
@router.callback_query(Text(startswith="user_inline:"))
|
||||
async def user_callback_inline(call: CallbackQuery, bot: Bot, state: FSM, aSession: AS, my_user):
|
||||
get_data = call.data.split(":")[1]
|
||||
|
||||
await call.answer(f"Click User - {get_data}", True)
|
||||
|
||||
Reference in New Issue
Block a user