from collections.abc import Awaitable, Callable from typing import Any from pydurian.db.utils import User from pyrogram import Client from pyrogram.types import KeyboardButton, Message, ReplyKeyboardMarkup, ReplyKeyboardRemove control_commands = [ "/start", "إلغاء ❌", ] CANCEL_BUTTON = ReplyKeyboardMarkup( [ [ KeyboardButton( text="إلغاء ❌", ) ] ], resize_keyboard=True, one_time_keyboard=True, ) FuncType = Callable[[Any, Any], Awaitable[Any]] async def handle_movement( function: FuncType, client: Client, message: Message, response: Message, user: User, ) -> None: if response.text in control_commands: return await function(client, message, user) return None async def canceled_message(message: Message) -> None: await message.reply("تم الإلغاء بنجاح ☑️", reply_markup=ReplyKeyboardRemove())