This interface is used to allow easy extension for other channel types. While also allowing APIPartialChannel to be used without breaking.

interface APIDMChannelBase<T extends ChannelType> {
    flags?: ChannelFlags;
    id: string;
    last_message_id?: null | string;
    last_pin_timestamp?: null | string;
    rate_limit_per_user?: number;
    recipients?: APIUser[];
    type: T;
}

Type Parameters

Hierarchy (View Summary)

Properties

flags?: ChannelFlags
id: string

The id of the channel

last_message_id?: null | string

The id of the last message sent in this channel (may not point to an existing or valid message)

last_pin_timestamp?: null | string

When the last pinned message was pinned. This may be null in events such as GUILD_CREATE when a message is not pinned

rate_limit_per_user?: number

Amount of seconds a user has to wait before sending another message (0-21600); bots, as well as users with the permission MANAGE_MESSAGES or MANAGE_CHANNELS, are unaffected

rate_limit_per_user also applies to thread creation. Users can send one message and create one thread during each rate_limit_per_user interval.

For thread channels, rate_limit_per_user is only returned if the field is set to a non-zero and non-null value. The absence of this field in API calls and Gateway events should indicate that slowmode has been reset to the default value.

recipients?: APIUser[]

The recipients of the DM

type: T

The type of the channel