Interface GroupMessageEvent

群消息

interface GroupMessageEvent {
    anonymous: null | Anonymous;
    atall: boolean;
    atme: boolean;
    block: boolean;
    body: Proto;
    div: number;
    font: string;
    frag: Proto;
    group: Group;
    group_id: number;
    group_name: string;
    head: Proto;
    index: number;
    info: Proto;
    member: Member;
    message: MessageElem[];
    message_id: string;
    message_type: "group";
    msg_id: bigint;
    nt: boolean;
    parsed: Parser;
    pktnum: number;
    post_type: "message";
    proto: Proto;
    rand: number;
    raw_message: string;
    sender: {
        age: number;
        area: string;
        card: string;
        level: number;
        nickname: string;
        role: GroupRole;
        sex: Gender;
        sub_id: string;
        title: string;
        uid: string;
        user_id: number;
    };
    seq: number;
    source?: Quotable;
    sub_type: "normal" | "anonymous";
    time: number;
    uid: string;
    user_id: number;
    get nickname(): string;
    recall(): Promise<boolean>;
    reply(content: Sendable, quote?: boolean): Promise<MessageRet>;
    serialize(): Buffer;
    toCqcode(): string;
    toJSON(keys: string[]): Record<string, any>;
    toString(): string;
}

Hierarchy (view full)

Properties

anonymous: null | Anonymous

匿名信息,sub_type"anonymous"时该属性有效

atall: boolean

是否AT全体成员

atme: boolean

是否AT我

block: boolean

未知属性

body: Proto
div: number
font: string
frag: Proto
group: Group

群对象

group_id: number

群号

group_name: string

群名

head: Proto
index: number
info: Proto
member: Member

发送者群员对象

message: MessageElem[]

消息元素数组

message_id: string = ""

cqhttp方法用

message_type: "group" = ...
msg_id: bigint

消息id

nt: boolean

是否nt版本消息

parsed: Parser
pktnum: number
post_type: "message" = ...
proto: Proto
rand: number

消息随机数

raw_message: string

字符串形式的消息

sender: {
    age: number;
    area: string;
    card: string;
    level: number;
    nickname: string;
    role: GroupRole;
    sex: Gender;
    sub_id: string;
    title: string;
    uid: string;
    user_id: number;
} = ...

发送方信息

Type declaration

  • age: number

    年龄,@deprecated

  • area: string

    地区,@deprecated

  • card: string

    名片

  • level: number

    等级

  • nickname: string

    昵称

  • role: GroupRole

    权限

  • sex: Gender

    性别,@deprecated

  • sub_id: string

    未知属性

  • title: string

    头衔

  • uid: string

    uid

  • user_id: number

    账号

seq: number

消息编号,在群消息中是唯一的 (私聊消息建议至少使用time,seq,rand中的两个判断唯一性)

source?: Quotable

引用回复

sub_type: "normal" | "anonymous"
time: number

消息时间

uid: string

发送者uid

user_id: number

该值永远指向消息发送者。 对于私聊消息,请使用from_idto_id来确定发送者和接收者。 建议使用 sender.user_id

未来会改为访问器,仅供内部转发消息时使用。

Accessors

  • get nickname(): string
  • 发送方昵称,仅供内部转发消息时使用

    Returns string

Methods

  • 快速撤回

    Returns Promise<boolean>