🚧 update cqcode

This commit is contained in:
yanyongyu 2020-12-23 17:12:53 +08:00
parent c3df90c541
commit 41663e1b08

View File

@ -47,6 +47,10 @@ class MessageSegment(BaseMessageSegment):
def at(user_id: Union[int, str]) -> "MessageSegment":
return MessageSegment("at", {"qq": str(user_id)})
@staticmethod
def contact(type_: str, id: int) -> "MessageSegment":
return MessageSegment("contact", {"type": type_, "id": str(id)})
@staticmethod
def contact_group(group_id: int) -> "MessageSegment":
return MessageSegment("contact", {"type": "group", "id": str(group_id)})
@ -143,7 +147,14 @@ class MessageSegment(BaseMessageSegment):
cache: Optional[bool] = None,
proxy: Optional[bool] = None,
timeout: Optional[int] = None) -> "MessageSegment":
return MessageSegment("record", {"file": file, "magic": _b2s(magic)})
return MessageSegment(
"record", {
"file": file,
"magic": _b2s(magic),
"cache": cache,
"proxy": proxy,
"timeout": timeout
})
@staticmethod
def reply(id_: int) -> "MessageSegment":