Variable segmentConst

segment: {
    at(qq: string | number, text?: string, dummy?: boolean): AtElem;
    bface(file: string, text: string): BfaceElem;
    dice(id?: number): MfaceElem;
    face(id: number): FaceElem;
    flash(file: string | Buffer | Readable, brief?: string, cache?: boolean, timeout?: number, headers?: OutgoingHttpHeaders): FlashElem;
    fromCqcode(str: string): MessageElem[];
    image(file: string | Buffer | Readable, brief?: string, cache?: boolean, timeout?: number, headers?: OutgoingHttpHeaders): ImageElem;
    json(data: any): JsonElem;
    location(lat: number, lng: number, address: string, id?: string): LocationElem;
    lottie(id: number, text?: string): {
        id: number;
        text: undefined | string;
        type: string;
    };
    mirai(data: string): MiraiElem;
    parseCqcode(str: string): MessageElem[];
    poke(id: number): PokeElem;
    record(file: string | Buffer, origin?: boolean, brief?: string): PttElem;
    rps(id?: number): MfaceElem;
    sface(id: number, text?: string): FaceElem;
    share(url: string, title: string, image?: string, content?: string): ShareElem;
    text(text: string): TextElem;
    toCqcode(elms: MessageElem[]): string;
    video(file: string, brief?: string): VideoElem;
    xml(data: string, id?: number): XmlElem;
} = ...

用于构造消息元素

Type declaration

  • at:function
    • mention @提及

      Parameters

      • qq: string | number

        全体成员: "all", 频道: tiny_id

      • Optional text: string
      • Optional dummy: boolean

      Returns AtElem

  • bface:function
    • 原创表情 (file 规则不明)

      Parameters

      • file: string
      • text: string

      Returns BfaceElem

  • dice:function
    • 骰子 (id = 1~6)

      Parameters

      • Optional id: number

      Returns MfaceElem

  • face:function
    • 经典表情 (id = 0~324)

      Parameters

      • id: number

      Returns FaceElem

  • flash:function
    • 闪照 (支持 https?://, base64://), brief 是外显文字

      Parameters

      • file: string | Buffer | Readable
      • Optional brief: string
      • Optional cache: boolean
      • Optional timeout: number
      • Optional headers: OutgoingHttpHeaders

      Returns FlashElem

  • fromCqcode:function
    • Deprecated

      将 CQ 码转换为消息链,已弃用,请使用 parseCqcode

      Parameters

      • str: string

      Returns MessageElem[]

  • image:function
    • 图片 (支持 https?://, base64://), brief 是外显文字

      Parameters

      • file: string | Buffer | Readable
      • Optional brief: string
      • Optional cache: boolean
      • Optional timeout: number
      • Optional headers: OutgoingHttpHeaders

      Returns ImageElem

  • json:function
    • Parameters

      • data: any

      Returns JsonElem

  • location:function
    • 位置分享

      Parameters

      • lat: number
      • lng: number
      • address: string
      • Optional id: string

      Returns LocationElem

  • lottie:function
    • 超级表情(id规则不明)

      Parameters

      • id: number
      • Optional text: string

      Returns {
          id: number;
          text: undefined | string;
          type: string;
      }

      • id: number
      • text: undefined | string
      • type: string
  • mirai:function
    • 一种特殊消息 (官方客户端无法解析)

      Parameters

      • data: string

      Returns MiraiElem

  • parseCqcode:function
    • 将 CQ 码转换为消息链

      Parameters

      • str: string

      Returns MessageElem[]

  • poke:function
    • id 0~6

      Parameters

      • id: number

      Returns PokeElem

  • record:function
    • 语音 (支持 https?://, base64://), origin 控制不转码直接发,PCQQ 会卡死,需要手机播放, brief 是外显文字

      Parameters

      • file: string | Buffer
      • origin: boolean = false
      • Optional brief: string

      Returns PttElem

  • rps:function
    • 猜拳 (id = 1~3)

      Parameters

      • Optional id: number

      Returns MfaceElem

  • sface:function
    • 小表情 (id 规则不明)

      Parameters

      • id: number
      • Optional text: string

      Returns FaceElem

  • share:function
    • 链接分享

      Parameters

      • url: string
      • title: string
      • Optional image: string
      • Optional content: string

      Returns ShareElem

  • text:function
    • Deprecated

      文本,建议直接使用字符串

      Parameters

      • text: string

      Returns TextElem

  • toCqcode:function
    • 将消息链转换为 CQ 码

      Parameters

      Returns string

  • video:function
    • 视频 (仅支持本地文件), brief 是外显文字

      Parameters

      • file: string
      • Optional brief: string

      Returns VideoElem

  • xml:function
    • Parameters

      • data: string
      • Optional id: number

      Returns XmlElem

Generated using TypeDoc