mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-06-19 19:08:13 +00: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":
|
def face(id_: int) -> "MessageSegment":
|
||||||
return MessageSegment("face", {"id": str(id_)})
|
return MessageSegment("face", {"id": str(id_)})
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def forward(id_: str) -> "MessageSegment":
|
||||||
|
return MessageSegment("forward", {"id": id_})
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def image(file: str) -> "MessageSegment":
|
def image(file: str) -> "MessageSegment":
|
||||||
return MessageSegment("image", {"file": "file"})
|
return MessageSegment("image", {"file": file})
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def location(latitude: float,
|
def location(latitude: float,
|
||||||
@ -191,6 +195,19 @@ class MessageSegment(BaseMessageSegment):
|
|||||||
"image": img_url
|
"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
|
@staticmethod
|
||||||
def poke(type_: str = "Poke") -> "MessageSegment":
|
def poke(type_: str = "Poke") -> "MessageSegment":
|
||||||
if type_ not in ["Poke"]:
|
if type_ not in ["Poke"]:
|
||||||
@ -203,6 +220,10 @@ class MessageSegment(BaseMessageSegment):
|
|||||||
def record(file: str, magic: bool = False) -> "MessageSegment":
|
def record(file: str, magic: bool = False) -> "MessageSegment":
|
||||||
return MessageSegment("record", {"file": file, "magic": _b2s(magic)})
|
return MessageSegment("record", {"file": file, "magic": _b2s(magic)})
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def replay(id_: int) -> "MessageSegment":
|
||||||
|
return MessageSegment("replay", {"id": str(id_)})
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def share(url: str = "",
|
def share(url: str = "",
|
||||||
title: str = "",
|
title: str = "",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user