mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-01-19 01:18:19 +08:00
add support for go-cqhttp cq code
This commit is contained in:
parent
5186231869
commit
950dbb1115
@ -136,9 +136,13 @@ class MessageSegment(BaseMessageSegment):
|
||||
def face(id_: int) -> "MessageSegment":
|
||||
return MessageSegment("face", {"id": str(id_)})
|
||||
|
||||
@staticmethod
|
||||
def forward(id_: str) -> "MessageSegment":
|
||||
return MessageSegment("forward", {"id": id_})
|
||||
|
||||
@staticmethod
|
||||
def image(file: str) -> "MessageSegment":
|
||||
return MessageSegment("image", {"file": "file"})
|
||||
return MessageSegment("image", {"file": file})
|
||||
|
||||
@staticmethod
|
||||
def location(latitude: float,
|
||||
@ -191,6 +195,19 @@ class MessageSegment(BaseMessageSegment):
|
||||
"image": img_url
|
||||
})
|
||||
|
||||
@staticmethod
|
||||
def node(id_: int) -> "MessageSegment":
|
||||
return MessageSegment("node", {"id": str(id_)})
|
||||
|
||||
@staticmethod
|
||||
def node_custom(name: str, uin: int,
|
||||
content: "Message") -> "MessageSegment":
|
||||
return MessageSegment("node", {
|
||||
"name": name,
|
||||
"uin": str(uin),
|
||||
"content": str(content)
|
||||
})
|
||||
|
||||
@staticmethod
|
||||
def poke(type_: str = "Poke") -> "MessageSegment":
|
||||
if type_ not in ["Poke"]:
|
||||
@ -203,6 +220,10 @@ class MessageSegment(BaseMessageSegment):
|
||||
def record(file: str, magic: bool = False) -> "MessageSegment":
|
||||
return MessageSegment("record", {"file": file, "magic": _b2s(magic)})
|
||||
|
||||
@staticmethod
|
||||
def replay(id_: int) -> "MessageSegment":
|
||||
return MessageSegment("replay", {"id": str(id_)})
|
||||
|
||||
@staticmethod
|
||||
def share(url: str = "",
|
||||
title: str = "",
|
||||
|
Loading…
Reference in New Issue
Block a user