feat(matrix): add adapter baseline and platform-aware command hints
This commit is contained in:
parent
bcdaea5143
commit
82eb711844
20 changed files with 1127 additions and 3 deletions
|
|
@ -4,9 +4,18 @@ from __future__ import annotations
|
|||
from core.protocol import IncomingMessage, OutgoingMessage, OutgoingTyping
|
||||
|
||||
|
||||
def _start_command(platform: str) -> str:
|
||||
return "!start" if platform == "matrix" else "/start"
|
||||
|
||||
|
||||
async def handle_message(event: IncomingMessage, auth_mgr, platform, chat_mgr, settings_mgr) -> list:
|
||||
if not await auth_mgr.is_authenticated(event.user_id):
|
||||
return [OutgoingMessage(chat_id=event.chat_id, text="Введите /start чтобы начать.")]
|
||||
return [
|
||||
OutgoingMessage(
|
||||
chat_id=event.chat_id,
|
||||
text=f"Введите {_start_command(event.platform)} чтобы начать.",
|
||||
)
|
||||
]
|
||||
|
||||
# Voice slot fallback: audio attachment without registered voice_handler
|
||||
if event.attachments and event.attachments[0].type == "audio":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue