Не получается создать ReplyMarkup с Web App
def app():
keyboard = ReplyKeyboardMarkup(
keyboard=[
[KeyboardButton(text='app',
web_app=WebAppInfo(url='https://fmontg.ru'))
]
],
resize_keyboard=True
)
return keyboard
вот код
ValidationError: 4 validation errors for SendMessage
reply_markup.InlineKeyboardMarkup
Input should be a valid dictionary or instance of InlineKeyboardMarkup [type=model_type, input_value=<function create_keyboard at 0x000002A67AF2A840>, input_type=function]
For further information visit https://errors.pydantic.dev/2.5/v/model_type
reply_markup.ReplyKeyboardMarkup
Input should be a valid dictionary or instance of ReplyKeyboardMarkup [type=model_type, input_value=<function create_keyboard at 0x000002A67AF2A840>, input_type=function]
For further information visit https://errors.pydantic.dev/2.5/v/model_type
reply_markup.ReplyKeyboardRemove
Input should be a valid dictionary or instance of ReplyKeyboardRemove [type=model_type, input_value=<function create_keyboard at 0x000002A67AF2A840>, input_type=function]
For further information visit https://errors.pydantic.dev/2.5/v/model_type
reply_markup.ForceReply
Input should be a valid dictionary or instance of ForceReply [type=model_type, input_value=<function create_keyboard at 0x000002A67AF2A840>, input_type=function]
For further information visit https://errors.pydantic.dev/2.5/v/model_type
Traceback (most recent call last):
File "C:\Users\user\PycharmProjects\Yourdream_bor\.venv\Lib\site-packages\aiogram\dispatcher\dispatcher.py", line 309, in _process_update
response = await self.feed_update(bot, update, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\user\PycharmProjects\Yourdream_bor\.venv\Lib\site-packages\aiogram\dispatcher\dispatcher.py", line 158, in feed_update
response = await self.update.wrap_outer_middleware(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\user\PycharmProjects\Yourdream_bor\.venv\Lib\site-packages\aiogram\dispatcher\middlewares\error.py", line 25, in __call__
return await handler(event, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\user\PycharmProjects\Yourdream_bor\.venv\Lib\site-packages\aiogram\dispatcher\middlewares\user_context.py", line 27, in __call__
return await handler(event, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\user\PycharmProjects\Yourdream_bor\.venv\Lib\site-packages\aiogram\fsm\middleware.py", line 41, in __call__
return await handler(event, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\user\PycharmProjects\Yourdream_bor\.venv\Lib\site-packages\aiogram\dispatcher\event\telegram.py", line 121, in trigger
return await wrapped_inner(event, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\user\PycharmProjects\Yourdream_bor\.venv\Lib\site-packages\aiogram\dispatcher\event\handler.py", line 43, in call
return await wrapped()
^^^^^^^^^^^^^^^
File "C:\Users\user\PycharmProjects\Yourdream_bor\.venv\Lib\site-packages\aiogram\dispatcher\dispatcher.py", line 276, in _listen_update
return await self.propagate_event(update_type=update_type, event=event, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\user\PycharmProjects\Yourdream_bor\.venv\Lib\site-packages\aiogram\dispatcher\router.py", line 128, in propagate_event
return await observer.wrap_outer_middleware(_wrapped, event=event, data=kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\user\PycharmProjects\Yourdream_bor\.venv\Lib\site-packages\aiogram\dispatcher\router.py", line 123, in _wrapped
return await self._propagate_event(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\user\PycharmProjects\Yourdream_bor\.venv\Lib\site-packages\aiogram\dispatcher\router.py", line 156, in _propagate_event
response = await router.propagate_event(update_type=update_type, event=event, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\user\PycharmProjects\Yourdream_bor\.venv\Lib\site-packages\aiogram\dispatcher\router.py", line 128, in propagate_event
return await observer.wrap_outer_middleware(_wrapped, event=event, data=kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\user\PycharmProjects\Yourdream_bor\.venv\Lib\site-packages\aiogram\dispatcher\router.py", line 123, in _wrapped
return await self._propagate_event(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\user\PycharmProjects\Yourdream_bor\.venv\Lib\site-packages\aiogram\dispatcher\router.py", line 148, in _propagate_event
response = await observer.trigger(event, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\user\PycharmProjects\Yourdream_bor\.venv\Lib\site-packages\aiogram\dispatcher\event\telegram.py", line 121, in trigger
return await wrapped_inner(event, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\user\PycharmProjects\Yourdream_bor\.venv\Lib\site-packages\aiogram\dispatcher\event\handler.py", line 43, in call
return await wrapped()
^^^^^^^^^^^^^^^
File "C:\Users\user\PycharmProjects\Yourdream_bor\bot\handler\start.py", line 35, in app
await message.answer('app', reply_markup=cl.create_keyboard)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\user\PycharmProjects\Yourdream_bor\.venv\Lib\site-packages\aiogram\types\message.py", line 1903, in answer
return SendMessage(
^^^^^^^^^^^^
File "C:\Users\user\PycharmProjects\Yourdream_bor\.venv\Lib\site-packages\pydantic\main.py", line 164, in __init__
__pydantic_self__.__pydantic_validator__.validate_python(data, self_instance=__pydantic_self__)
pydantic_core._pydantic_core.ValidationError: 4 validation errors for SendMessage
reply_markup.InlineKeyboardMarkup
Input should be a valid dictionary or instance of InlineKeyboardMarkup [type=model_type, input_value=<function create_keyboard at 0x000002A67AF2A840>, input_type=function]
For further information visit https://errors.pydantic.dev/2.5/v/model_type
reply_markup.ReplyKeyboardMarkup
Input should be a valid dictionary or instance of ReplyKeyboardMarkup [type=model_type, input_value=<function create_keyboard at 0x000002A67AF2A840>, input_type=function]
For further information visit https://errors.pydantic.dev/2.5/v/model_type
reply_markup.ReplyKeyboardRemove
Input should be a valid dictionary or instance of ReplyKeyboardRemove [type=model_type, input_value=<function create_keyboard at 0x000002A67AF2A840>, input_type=function]
For further information visit https://errors.pydantic.dev/2.5/v/model_type
reply_markup.ForceReply
Input should be a valid dictionary or instance of ForceReply [type=model_type, input_value=<function create_keyboard at 0x000002A67AF2A840>, input_type=function]
For further information visit https://errors.pydantic.dev/2.5/v/model_type
ошибка