ShopBot/handlers/callback/operator/support.py

14 lines
485 B
Python
Raw Normal View History

2022-06-05 15:07:48 +03:00
from aiogram import types
from aiogram.dispatcher import FSMContext
from load import dp
@dp.callback_query_handler(lambda x: x.data.split("|")[0] == "support")
async def support(callback: types.CallbackQuery, state: FSMContext):
user_id = int(callback.data.split("|")[1])
support_id = int(callback.data.split("|")[2])
await callback.answer()
await state.set_state(state="wait_for_support_message")
await state.update_data(support_id=support_id, user_id=user_id)