Hierarchy

Constructors

  • Parameters

    • client: Client
    • data: {
          _id: string;
          channel_type: "SavedMessages";
          user: string;
      } | {
          _id: string;
          active: boolean;
          channel_type: "DirectMessage";
          last_message_id?: string;
          recipients: string[];
      } | {
          _id: string;
          channel_type: "Group";
          description?: string;
          icon?: {
              _id: string;
              content_type: string;
              deleted?: boolean;
              filename: string;
              message_id?: string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: string;
              reported?: boolean;
              server_id?: string;
              size: number;
              tag: string;
              user_id?: string;
          };
          last_message_id?: string;
          name: string;
          nsfw?: boolean;
          owner: string;
          permissions?: number;
          recipients: string[];
      } | {
          _id: string;
          channel_type: "TextChannel";
          default_permissions?: {
              a: number;
              d: number;
          };
          description?: string;
          icon?: {
              _id: string;
              content_type: string;
              deleted?: boolean;
              filename: string;
              message_id?: string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: string;
              reported?: boolean;
              server_id?: string;
              size: number;
              tag: string;
              user_id?: string;
          };
          last_message_id?: string;
          name: string;
          nsfw?: boolean;
          role_permissions?: {
              [key: string]: components["schemas"]["OverrideField"];
          };
          server: string;
      } | {
          _id: string;
          channel_type: "VoiceChannel";
          default_permissions?: {
              a: number;
              d: number;
          };
          description?: string;
          icon?: {
              _id: string;
              content_type: string;
              deleted?: boolean;
              filename: string;
              message_id?: string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: string;
              reported?: boolean;
              server_id?: string;
              size: number;
              tag: string;
              user_id?: string;
          };
          name: string;
          nsfw?: boolean;
          role_permissions?: {
              [key: string]: components["schemas"]["OverrideField"];
          };
          server: string;
      }

    Returns GroupDMChannel

Properties

client: Client
deleted: boolean = false
messages: MessageManager
typingIDs: Set<string> = ...

Can include your own user ID.

Accessors

  • get source(): {
        _id: string;
        channel_type: "Group";
        description?: string;
        icon?: {
            _id: string;
            content_type: string;
            deleted?: boolean;
            filename: string;
            message_id?: string;
            metadata: {
                type: "File";
            } | {
                type: "Text";
            } | {
                height: number;
                type: "Image";
                width: number;
            } | {
                height: number;
                type: "Video";
                width: number;
            } | {
                type: "Audio";
            };
            object_id?: string;
            reported?: boolean;
            server_id?: string;
            size: number;
            tag: string;
            user_id?: string;
        };
        last_message_id?: string;
        name: string;
        nsfw?: boolean;
        owner: string;
        permissions?: number;
        recipients: string[];
    }
  • Original API object.

    Returns {
        _id: string;
        channel_type: "Group";
        description?: string;
        icon?: {
            _id: string;
            content_type: string;
            deleted?: boolean;
            filename: string;
            message_id?: string;
            metadata: {
                type: "File";
            } | {
                type: "Text";
            } | {
                height: number;
                type: "Image";
                width: number;
            } | {
                height: number;
                type: "Video";
                width: number;
            } | {
                type: "Audio";
            };
            object_id?: string;
            reported?: boolean;
            server_id?: string;
            size: number;
            tag: string;
            user_id?: string;
        };
        last_message_id?: string;
        name: string;
        nsfw?: boolean;
        owner: string;
        permissions?: number;
        recipients: string[];
    }

    • _id: string

      Description

      Unique Id

    • channel_type: "Group"
    • Optional description?: string

      Description

      Channel description

    • Optional icon?: {
          _id: string;
          content_type: string;
          deleted?: boolean;
          filename: string;
          message_id?: string;
          metadata: {
              type: "File";
          } | {
              type: "Text";
          } | {
              height: number;
              type: "Image";
              width: number;
          } | {
              height: number;
              type: "Video";
              width: number;
          } | {
              type: "Audio";
          };
          object_id?: string;
          reported?: boolean;
          server_id?: string;
          size: number;
          tag: string;
          user_id?: string;
      }

      Description

      Custom icon attachment

      • _id: string

        Description

        Unique Id

      • content_type: string

        Description

        Raw content type of this file

      • Optional deleted?: boolean

        Description

        Whether this file was deleted

      • filename: string

        Description

        Original filename

      • Optional message_id?: string
      • metadata: {
            type: "File";
        } | {
            type: "Text";
        } | {
            height: number;
            type: "Image";
            width: number;
        } | {
            height: number;
            type: "Video";
            width: number;
        } | {
            type: "Audio";
        }

        Description

        Parsed metadata of this file

      • Optional object_id?: string

        Description

        Id of the object this file is associated with

      • Optional reported?: boolean

        Description

        Whether this file was reported

      • Optional server_id?: string
      • size: number

        Format: int

        Description

        Size of this file (in bytes)

      • tag: string

        Description

        Tag / bucket this file was uploaded to

      • Optional user_id?: string
    • Optional last_message_id?: string

      Description

      Id of the last message sent in this channel

    • name: string

      Description

      Display name of the channel

    • Optional nsfw?: boolean

      Description

      Whether this group is marked as not safe for work

    • owner: string

      Description

      User id of the owner of the group

    • Optional permissions?: number

      Format: int64

      Description

      Permissions assigned to members of this group (does not apply to the owner of the group)

    • recipients: string[]

      Description

      Array of user ids participating in channel

Methods

  • Parameters

    • data: {
          archived?: boolean;
          description?: string;
          icon?: string;
          name?: string;
          nsfw?: boolean;
          owner?: string;
          remove?: ("Description" | "Icon" | "DefaultPermissions")[];
      }
      • Optional archived?: boolean

        Description

        Whether this channel is archived

      • Optional description?: string

        Description

        Channel description

      • Optional icon?: string

        Description

        Icon

        Provide an Autumn attachment Id.

      • Optional name?: string

        Description

        Channel name

      • Optional nsfw?: boolean

        Description

        Whether this channel is age-restricted

      • Optional owner?: string

        Description

        Group owner

      • Optional remove?: ("Description" | "Icon" | "DefaultPermissions")[]

    Returns Promise<GroupDMChannel>

  • Runs all of the callbacks for this emitter. (meant to run when an update occurs)

    Parameters

    • Optional updated: any[]

      The objects that caused this update.

    Returns void

  • Syncs unreads from server and marks channel as read if unread.

    Parameters

    • useSeparate: boolean = false

      If true, will create a new unread object to avoid 'unread flashing'.

    Returns Promise<void>

  • Set permissions for a role or 'default' for everyone.

    Parameters

    • role: Role | "default"
    • permissions: {
          allow: number;
          deny: number;
      }
      • allow: number

        Format: uint64

        Description

        Allow bit flags

      • deny: number

        Format: uint64

        Description

        Disallow bit flags

    Returns Promise<void>

  • Update this object with new API data.

    Parameters

    • data: Partial<{
          _id: string;
          channel_type: "SavedMessages";
          user: string;
      } | {
          _id: string;
          active: boolean;
          channel_type: "DirectMessage";
          last_message_id?: string;
          recipients: string[];
      } | {
          _id: string;
          channel_type: "Group";
          description?: string;
          icon?: {
              _id: string;
              content_type: string;
              deleted?: boolean;
              filename: string;
              message_id?: string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: string;
              reported?: boolean;
              server_id?: string;
              size: number;
              tag: string;
              user_id?: string;
          };
          last_message_id?: string;
          name: string;
          nsfw?: boolean;
          owner: string;
          permissions?: number;
          recipients: string[];
      } | {
          _id: string;
          channel_type: "TextChannel";
          default_permissions?: {
              a: number;
              d: number;
          };
          description?: string;
          icon?: {
              _id: string;
              content_type: string;
              deleted?: boolean;
              filename: string;
              message_id?: string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: string;
              reported?: boolean;
              server_id?: string;
              size: number;
              tag: string;
              user_id?: string;
          };
          last_message_id?: string;
          name: string;
          nsfw?: boolean;
          role_permissions?: {
              [key: string]: components["schemas"]["OverrideField"];
          };
          server: string;
      } | {
          _id: string;
          channel_type: "VoiceChannel";
          default_permissions?: {
              a: number;
              d: number;
          };
          description?: string;
          icon?: {
              _id: string;
              content_type: string;
              deleted?: boolean;
              filename: string;
              message_id?: string;
              metadata: {
                  type: "File";
              } | {
                  type: "Text";
              } | {
                  height: number;
                  type: "Image";
                  width: number;
              } | {
                  height: number;
                  type: "Video";
                  width: number;
              } | {
                  type: "Audio";
              };
              object_id?: string;
              reported?: boolean;
              server_id?: string;
              size: number;
              tag: string;
              user_id?: string;
          };
          name: string;
          nsfw?: boolean;
          role_permissions?: {
              [key: string]: components["schemas"]["OverrideField"];
          };
          server: string;
      }> = {}

    Returns GroupDMChannel