mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-01-31 23:51:28 +08:00
🚧 add todo
This commit is contained in:
parent
7c7994e2e2
commit
af6f63dc44
@ -30,6 +30,7 @@ async def _check_reply(bot: "Bot", event: "Event"):
|
|||||||
* ``bot: Bot``: Bot 对象
|
* ``bot: Bot``: Bot 对象
|
||||||
* ``event: Event``: Event 对象
|
* ``event: Event``: Event 对象
|
||||||
"""
|
"""
|
||||||
|
#TODO:实现该函数
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
||||||
@ -44,6 +45,7 @@ def _check_at_me(bot: "Bot", event: "Event"):
|
|||||||
* ``bot: Bot``: Bot 对象
|
* ``bot: Bot``: Bot 对象
|
||||||
* ``event: Event``: Event 对象
|
* ``event: Event``: Event 对象
|
||||||
"""
|
"""
|
||||||
|
#TODO:实现该函数
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
||||||
@ -58,6 +60,7 @@ def _check_nickname(bot: "Bot", event: "Event"):
|
|||||||
* ``bot: Bot``: Bot 对象
|
* ``bot: Bot``: Bot 对象
|
||||||
* ``event: Event``: Event 对象
|
* ``event: Event``: Event 对象
|
||||||
"""
|
"""
|
||||||
|
#TODO:实现该函数
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
||||||
@ -272,8 +275,10 @@ class Bot(BaseBot):
|
|||||||
return await super().call_api(api, **data)
|
return await super().call_api(api, **data)
|
||||||
|
|
||||||
@overrides(BaseBot)
|
@overrides(BaseBot)
|
||||||
async def send(self, event: Event, message: Union[str, Message,
|
async def send(self,
|
||||||
MessageSegment],
|
event: Event,
|
||||||
|
message: Union[str, Message, MessageSegment],
|
||||||
|
at_sender: bool = False,
|
||||||
**kwargs) -> Any:
|
**kwargs) -> Any:
|
||||||
msg = message if isinstance(message, Message) else Message(message)
|
msg = message if isinstance(message, Message) else Message(message)
|
||||||
|
|
||||||
@ -285,6 +290,11 @@ class Bot(BaseBot):
|
|||||||
raise ValueError(
|
raise ValueError(
|
||||||
"Cannot guess `receive_id` and `receive_id_type` to reply!")
|
"Cannot guess `receive_id` and `receive_id_type` to reply!")
|
||||||
|
|
||||||
|
at_sender = at_sender and bool(event.get_user_id())
|
||||||
|
|
||||||
|
if at_sender and receive_id_type != "union_id":
|
||||||
|
msg += MessageSegment.at(event.get_user_id(), "StarHeart") + " "
|
||||||
|
|
||||||
msg_type, content = MessageSerializer(msg).serialize()
|
msg_type, content = MessageSerializer(msg).serialize()
|
||||||
|
|
||||||
params = {
|
params = {
|
||||||
|
@ -97,6 +97,7 @@ class EventMessage(BaseModel):
|
|||||||
|
|
||||||
@root_validator(pre=True)
|
@root_validator(pre=True)
|
||||||
def parse_message(cls, values: dict):
|
def parse_message(cls, values: dict):
|
||||||
|
#TODO:解析mentions替换message的user_id,传入deserializer
|
||||||
values["content"] = MessageDeserializer(
|
values["content"] = MessageDeserializer(
|
||||||
values["message_type"],
|
values["message_type"],
|
||||||
json.loads(values["content"])).deserialize()
|
json.loads(values["content"])).deserialize()
|
||||||
@ -187,10 +188,12 @@ class MessageReadEvent(Event):
|
|||||||
|
|
||||||
|
|
||||||
class NoticeEvent(Event):
|
class NoticeEvent(Event):
|
||||||
|
#TODO:实现该事件
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
||||||
class MetaEvent(Event):
|
class MetaEvent(Event):
|
||||||
|
#TODO:实现该事件
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user