bot works as echo (adding templates s functional)
tpl_list dont
This commit is contained in:
@@ -12,7 +12,10 @@ from .handlers.templates import (
|
||||
handle_template_name,
|
||||
handle_template_text,
|
||||
handle_template_keyboard,
|
||||
list_templates
|
||||
list_templates,
|
||||
handle_template_selection,
|
||||
handle_template_vars,
|
||||
handle_preview_confirmation
|
||||
)
|
||||
from .handlers.posts import (
|
||||
newpost,
|
||||
@@ -41,7 +44,10 @@ def register_handlers(app: Application) -> None:
|
||||
|
||||
# Шаблоны
|
||||
template_handler = ConversationHandler(
|
||||
entry_points=[CommandHandler("newtemplate", start_template_creation)],
|
||||
entry_points=[
|
||||
CommandHandler("newtemplate", start_template_creation),
|
||||
CommandHandler("tpl_list", list_templates)
|
||||
],
|
||||
states={
|
||||
BotStates.TPL_TYPE: [
|
||||
CallbackQueryHandler(handle_template_type)
|
||||
@@ -54,6 +60,15 @@ def register_handlers(app: Application) -> None:
|
||||
],
|
||||
BotStates.TPL_NEW_KB: [
|
||||
MessageHandler(filters.TEXT & ~filters.COMMAND, handle_template_keyboard)
|
||||
],
|
||||
BotStates.SELECT_TEMPLATE: [
|
||||
CallbackQueryHandler(handle_template_selection, pattern=r"^template:")
|
||||
],
|
||||
BotStates.TEMPLATE_VARS: [
|
||||
MessageHandler(filters.TEXT & ~filters.COMMAND, handle_template_vars)
|
||||
],
|
||||
BotStates.PREVIEW_CONFIRM: [
|
||||
CallbackQueryHandler(handle_preview_confirmation, pattern=r"^preview:")
|
||||
]
|
||||
},
|
||||
fallbacks=[CommandHandler("cancel", cancel)]
|
||||
|
||||
Reference in New Issue
Block a user