revbot.js
    Preparing search index...

    Class GroupChannel

    Represents a group channel, which allows multiple users to communicate.

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    • Creates a new GroupChannel instance.

      Parameters

      • client: client

        The client instance.

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

        The raw data for the group channel from the API.

        • _id: string

          Unique Id

        • channel_type: "Group"
        • Optionaldescription?: null | string

          Channel description

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

          Custom icon attachment

        • Optionallast_message_id?: null | string

          Id of the last message sent in this channel

        • name: string

          Display name of the channel

        • Optionalnsfw?: boolean

          Whether this group is marked as not safe for work

        • owner: string

          User id of the owner of the group

        • Optionalpermissions?: null | number

          Format: int64

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

        • recipients: string[]

          Array of user ids participating in channel

      Returns GroupChannel

    Properties

    client: client

    The client instance.

    description: null | string = null

    The description of the group channel, if any.

    icon: null | Attachment = null

    The icon of the group channel, if any.

    id: string

    The unique identifier for the object.

    lastMessageId: null | string = null

    The ID of the last message sent in this group channel, if any.

    messages: MessageManager = ...

    Manages the messages in this group channel.

    name: string

    The name of the group channel.

    nsfw: boolean = false

    Whether the group channel is marked as NSFW (Not Safe For Work).

    ownerId: string

    The ID of the user who owns the group channel.

    The permissions for the group channel.

    type: GROUP = ChannelTypes.GROUP

    The type of the channel, which is always GROUP for group channels.

    users: Map<string, User> = ...

    A map of user IDs to their corresponding User instances in the group channel.

    Accessors

    • get createdTimestamp(): number

      Gets the timestamp (in milliseconds) when the channel was created.

      Returns number

      The timestamp of the channel's creation.

    Methods

    • Updates the object with new data and returns a clone of the object.

      Parameters

      • data: PartialObject

        The data to update the object with.

      • Optionalclear: string[]

        Fields to clear in the object.

      Returns this

      A clone of the updated object.

    • Deletes the current channel instance from the client's channel collection.

      This method interacts with the client's channel management system to remove the channel. Once deleted, the channel will no longer be accessible through the client.

      Returns Promise<void>

      A promise that resolves when the channel has been successfully deleted.

      const channel = client.channels.get('1234567890');
      if (channel) {
      await channel.delete();
      console.log('Channel deleted successfully.');
      }