mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-01-19 01:18:19 +08:00
⚗️ change allowed types for cqhttp #222
Co-authored-by: synodriver <624805065@qq.com>
This commit is contained in:
parent
2c85b2aa19
commit
f9d4bcba3d
@ -351,7 +351,7 @@ class Event(abc.ABC, BaseModel):
|
||||
json_encoders = {Message: DataclassEncoder}
|
||||
|
||||
@abc.abstractmethod
|
||||
def get_type(self) -> Literal["message", "notice", "request", "meta_event"]:
|
||||
def get_type(self) -> str:
|
||||
"""
|
||||
:说明:
|
||||
|
||||
@ -360,6 +360,7 @@ class Event(abc.ABC, BaseModel):
|
||||
:返回:
|
||||
|
||||
* ``Literal["message", "notice", "request", "meta_event"]``
|
||||
* ``str``
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
|
@ -25,10 +25,10 @@ class Event(BaseEvent):
|
||||
__event__ = ""
|
||||
time: int
|
||||
self_id: int
|
||||
post_type: Literal["message", "notice", "request", "meta_event"]
|
||||
post_type: str
|
||||
|
||||
@overrides(BaseEvent)
|
||||
def get_type(self) -> Literal["message", "notice", "request", "meta_event"]:
|
||||
def get_type(self) -> str:
|
||||
return self.post_type
|
||||
|
||||
@overrides(BaseEvent)
|
||||
|
Loading…
Reference in New Issue
Block a user