Refactor voice handler and update welcome message
- Reintroduced the cancel handler registration in the voice handler for private chats, ensuring users can cancel interactions with the bot. - Updated the welcome message in the messages utility to reflect the new voice bot access method and added instructions for using the /restart command. - Improved clarity in the welcome message by including a link to the bot's help command and contact information for user support.
This commit is contained in:
@@ -36,6 +36,12 @@ class VoiceHandlers:
|
||||
self.router.message.middleware(BlacklistMiddleware())
|
||||
|
||||
def _setup_handlers(self):
|
||||
self.router.message.register(
|
||||
self.cancel_handler,
|
||||
ChatTypeFilter(chat_type=["private"]),
|
||||
F.text == "Отменить"
|
||||
)
|
||||
|
||||
# Обработчик кнопки "Голосовой бот"
|
||||
self.router.message.register(
|
||||
self.voice_bot_button_handler,
|
||||
@@ -97,12 +103,6 @@ class VoiceHandlers:
|
||||
)
|
||||
|
||||
# Новые обработчики кнопок
|
||||
self.router.message.register(
|
||||
self.cancel_handler,
|
||||
ChatTypeFilter(chat_type=["private"]),
|
||||
F.text == "Отменить"
|
||||
)
|
||||
|
||||
self.router.message.register(
|
||||
self.refresh_listen_function,
|
||||
ChatTypeFilter(chat_type=["private"]),
|
||||
|
||||
Reference in New Issue
Block a user