🚧 add event parser

This commit is contained in:
yanyongyu
2020-12-09 19:57:49 +08:00
parent 2c97902f4e
commit 783efeaf0e
7 changed files with 202 additions and 118 deletions

View File

@ -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)