mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-01-31 15:41:34 +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}
|
json_encoders = {Message: DataclassEncoder}
|
||||||
|
|
||||||
@abc.abstractmethod
|
@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"]``
|
* ``Literal["message", "notice", "request", "meta_event"]``
|
||||||
|
* ``str``
|
||||||
"""
|
"""
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
@ -25,10 +25,10 @@ class Event(BaseEvent):
|
|||||||
__event__ = ""
|
__event__ = ""
|
||||||
time: int
|
time: int
|
||||||
self_id: int
|
self_id: int
|
||||||
post_type: Literal["message", "notice", "request", "meta_event"]
|
post_type: str
|
||||||
|
|
||||||
@overrides(BaseEvent)
|
@overrides(BaseEvent)
|
||||||
def get_type(self) -> Literal["message", "notice", "request", "meta_event"]:
|
def get_type(self) -> str:
|
||||||
return self.post_type
|
return self.post_type
|
||||||
|
|
||||||
@overrides(BaseEvent)
|
@overrides(BaseEvent)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user