Skip to content

Commit

Permalink
feat(helpdesk): add start button on finish/cancel (#1209)
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxuz authored Jun 15, 2024
1 parent 8d027af commit 24dee08
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions helpdeskbot/handlers/question.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ class ReviewKeyboard(Enum):
CANCEL = "❌ Отменить"


start_markup = ReplyKeyboardMarkup(
[["/start"]], resize_keyboard=True
)

review_markup = ReplyKeyboardMarkup([
[ReviewKeyboard.CREATE.value, ReviewKeyboard.EDIT.value],
[ReviewKeyboard.CANCEL.value]
Expand Down Expand Up @@ -275,7 +279,7 @@ def finish_review(update: Update, context: CallbackContext) -> State:
send_reply(
update,
f"🎉 Вопрос опубликован: <a href=\"{link}\">ссылка и ответы в канале</a>",
reply_markup=ReplyKeyboardRemove(),
reply_markup=start_markup,
)
return ConversationHandler.END

Expand All @@ -286,7 +290,7 @@ def finish_review(update: Update, context: CallbackContext) -> State:
send_reply(
update,
"🫡 Создание вопроса отменено. Можно начать заново — /start",
reply_markup=ReplyKeyboardRemove(),
reply_markup=start_markup,
)
return ConversationHandler.END

Expand Down

0 comments on commit 24dee08

Please sign in to comment.