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 Channel

Properties

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

Can include your own user ID.

Accessors

Methods

  • Delete or leave this channel.

    Parameters

    • Optional silent: boolean

    Returns Promise<void>

  • 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<Channel>

  • 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 Channel