fix: exclude commands from message handler, remove bad register call

This commit is contained in:
Mikhail Putilovskij 2026-03-31 22:38:14 +03:00
parent 763eba2817
commit 5bbd336f58
2 changed files with 2 additions and 3 deletions

View file

@ -53,7 +53,6 @@ def build_event_dispatcher(platform: MockPlatformClient) -> EventDispatcher:
)
# Register core handlers
ed.register(type(None).__mro__[0], "start", handle_start) # placeholder
from core.protocol import IncomingCommand, IncomingMessage, IncomingCallback
ed.register(IncomingCommand, "start", handle_start)
ed.register(IncomingCommand, "settings", handle_settings)

View file

@ -4,7 +4,7 @@ from __future__ import annotations
import asyncio
from aiogram import F, Router
from aiogram.filters import Command
from aiogram.filters import Command, CommandObject
from aiogram.fsm.context import FSMContext
from aiogram.types import CallbackQuery, Message
@ -30,7 +30,7 @@ async def _send_outgoing(message: Message, chat_name: str, events: list) -> None
await message.answer(format_outgoing(chat_name, event))
@router.message(ChatState.idle, F.text | F.photo | F.document | F.voice)
@router.message(ChatState.idle, (F.text | F.photo | F.document | F.voice) & ~F.text.startswith("/"))
async def handle_message(
message: Message,
state: FSMContext,