constsegment:object
消息段构造器:按类型快速生成消息段
Type Declaration
at()
readonlyat(target):MessageSegment
Parameters
target
Returns
button()
readonlybutton(options):MessageSegment
Parameters
options
Returns
face()
readonlyface(id):MessageSegment
Parameters
id
string | number
Returns
file()
readonlyfile(file,options?):MessageSegment
Parameters
file
string | Buffer<ArrayBufferLike>
options?
local?
boolean
name?
string
Returns
forward()
readonlyforward(id):MessageSegment
Parameters
id
string
Returns
image()
readonlyimage(file,options?):MessageSegment
file 为 URL 或本地路径;传 Buffer 会转成 base64 发送
Parameters
file
string | Buffer<ArrayBufferLike>
options?
object & Attachment = {}
Returns
json()
readonlyjson(data):MessageSegment
Parameters
data
string | Record<string, unknown>
Returns
markdown()
readonlymarkdown(content):MessageSegment
Parameters
content
string
Returns
node()
readonlynode(options):MessageSegment
Parameters
options
content
nickname
string
user_id
Returns
raw()
readonlyraw(type,data,attachment?):MessageSegment
Parameters
type
string
data
Record<string, unknown>
attachment?
Returns
record()
readonlyrecord(file,options?):MessageSegment
Parameters
file
string | Buffer<ArrayBufferLike>
options?
local?
boolean
Returns
reply()
readonlyreply(messageId):MessageSegment
Parameters
messageId
Returns
text()
readonlytext(text):MessageSegment
Parameters
text
string
Returns
video()
readonlyvideo(file,options?):MessageSegment
Parameters
file
string | Buffer<ArrayBufferLike>
options?
local?
boolean
