Add button to join the project
This commit is contained in:
parent
2a85be2f6f
commit
4b5a42d254
|
@ -3,6 +3,8 @@ from loguru import logger
|
|||
from aiogram import types
|
||||
from aiogram.dispatcher import FSMContext
|
||||
|
||||
from keyboards.inline import get_join_project_kb
|
||||
|
||||
from states.project import ProjectStates
|
||||
from services.repositories import Repos, ProjectRepo, UserRepo
|
||||
|
||||
|
@ -24,5 +26,6 @@ async def search_for_projects(
|
|||
for project in projects:
|
||||
await message.answer(
|
||||
f"<b>{project['name']}</b>\n\n {project['description']}",
|
||||
parse_mode="html"
|
||||
reply_markup=get_join_project_kb(project["id"]),
|
||||
parse_mode="html",
|
||||
)
|
||||
|
|
13
keyboards/inline.py
Normal file
13
keyboards/inline.py
Normal file
|
@ -0,0 +1,13 @@
|
|||
from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton
|
||||
|
||||
|
||||
def get_join_project_kb(project_id: int) -> InlineKeyboardMarkup:
|
||||
return InlineKeyboardMarkup(
|
||||
inline_keyboard=[
|
||||
[
|
||||
InlineKeyboardButton(
|
||||
"Присоединиться 💚", callback_data=str(project_id)
|
||||
),
|
||||
],
|
||||
]
|
||||
)
|
Reference in a new issue