interface Client {
    client.close: string;
    client.dead: any;
    client.dm: {
        content: string;
        reply: ((message: string) => Promise<void>);
        user: Classes.Relationship;
    };
    client.error: string;
    client.friended: {
        avatar: number;
        id: string;
        name: string;
    };
    client.game.abort: void;
    client.game.end: {
        players: {
            id: string;
            name: string;
            points: number;
            won: boolean;
        }[];
    };
    client.game.over:
        | {
            data: {
                gameoverreason: GameOverReason;
                killer: {
                    gameid: number;
                    type: "sizzle";
                    username: null | string;
                };
            };
            reason: "finish";
        }
        | {
            reason: "abort";
        }
        | {
            reason: "end";
        }
        | {
            reason: "leave";
        };
    client.game.round.end: string;
    client.game.round.start: [((cb: Func) => void), Engine, {
        engine: Engine;
        gameid: number;
        name: string;
    }[]];
    client.game.start: ({
        multi: false;
    } | {
        ft: number;
        multi: true;
        wb: number;
    }) & {
        players: {
            id: string;
            name: string;
            points: 0;
        }[];
    };
    client.notify: {
        bgcolor?: `#${string}`;
        buttons?: {
            classes?: string;
            icon?: string;
            label: string;
        }[];
        classes?: string;
        color?: `#${string}`;
        fcolor?: `#${string}`;
        header?: string;
        icon?: string;
        id?: string;
        msg: string;
        subcolor?: `#${string}`;
        subicon?: string;
        timeout?: number;
    };
    client.ready: {
        endpoint: string;
        social: {
            notifications: Notification[];
            presences: {
                [userId: string]: {
                    detail: string;
                    invitable: boolean;
                    status: string;
                };
            };
            relationships: Types.Social.Relationship[];
            total_online: number;
        };
    };
    client.ribbon.receive: {
        command: string;
        data?: any;
    };
    client.ribbon.send: {
        command: string;
        data?: any;
    };
    client.room.join: Classes.Room;
    client.room.players: Player[];
}

Properties

client.close: string

Never fires yet

client.dead: any

Fires when the client dies.

client.dm: {
    content: string;
    reply: ((message: string) => Promise<void>);
    user: Classes.Relationship;
}

Fires when a DM (direct message) has been received and AFTER any unknown data has been loaded about the user

client.error: string

Fires when recieving an "err" notification. Data is the "msg" of the notification

client.friended: {
    avatar: number;
    id: string;
    name: string;
}

Fires whenever the client is friended

client.game.abort: void

Same as game.abort

client.game.end: {
    players: {
        id: string;
        name: string;
        points: number;
        won: boolean;
    }[];
}

Fires when a game ends. Likely known issue:

client.game.over:
    | {
        data: {
            gameoverreason: GameOverReason;
            killer: {
                gameid: number;
                type: "sizzle";
                username: null | string;
            };
        };
        reason: "finish";
    }
    | {
        reason: "abort";
    }
    | {
        reason: "end";
    }
    | {
        reason: "leave";
    }

Fires when the client's game ends (topout). Finish = game.replay.end, abort = game.abort, end = game.end or game.advance or game.score

client.game.round.end: string

Fires when a round is over, sends the gameid of the winning player.

client.game.round.start: [((cb: Func) => void), Engine, {
    engine: Engine;
    gameid: number;
    name: string;
}[]]

Fires when a round starts (this includes 1-round games)

client.game.start: ({
    multi: false;
} | {
    ft: number;
    multi: true;
    wb: number;
}) & {
    players: {
        id: string;
        name: string;
        points: 0;
    }[];
}

Fires when a game starts

client.notify: {
    bgcolor?: `#${string}`;
    buttons?: {
        classes?: string;
        icon?: string;
        label: string;
    }[];
    classes?: string;
    color?: `#${string}`;
    fcolor?: `#${string}`;
    header?: string;
    icon?: string;
    id?: string;
    msg: string;
    subcolor?: `#${string}`;
    subicon?: string;
    timeout?: number;
}

Any notification popup

client.ready: {
    endpoint: string;
    social: {
        notifications: Notification[];
        presences: {
            [userId: string]: {
                detail: string;
                invitable: boolean;
                status: string;
            };
        };
        relationships: Types.Social.Relationship[];
        total_online: number;
    };
}

Fires inside Client.create(), will never fire afterwards.

client.ribbon.receive: {
    command: string;
    data?: any;
}

Fires when a message is recived from the server. Contains the raw data of the server message. Useful for logging, do not use for handling events for functionality. Instead, use client.on(<event>).

client.ribbon.send: {
    command: string;
    data?: any;
}

Fires when a message is sent to the server. Contains the raw data of the server message. Useful for logging.

client.room.join: Classes.Room

Fires when the client joins a room

client.room.players: Player[]

Fires whenever the players state changes.