mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-28 00:31:14 +00:00
🚧 add event parser
This commit is contained in:
@ -6,10 +6,10 @@
|
||||
"""
|
||||
|
||||
import abc
|
||||
from typing_extensions import Literal
|
||||
from functools import reduce, partial
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Any, Dict, Union, TypeVar, Optional, Callable, Iterable, Awaitable, Generic, TYPE_CHECKING
|
||||
from typing_extensions import Literal
|
||||
from typing import Any, Dict, Union, Optional, Callable, Iterable, Awaitable, TYPE_CHECKING
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
@ -162,6 +162,14 @@ class Event(abc.ABC, BaseModel):
|
||||
def get_session_id(self) -> str:
|
||||
raise NotImplementedError
|
||||
|
||||
@abc.abstractmethod
|
||||
def get_message(self) -> "Message":
|
||||
raise NotImplementedError
|
||||
|
||||
@abc.abstractmethod
|
||||
def get_plaintext(self) -> str:
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
# T = TypeVar("T", bound=BaseModel)
|
||||
|
||||
|
Reference in New Issue
Block a user