revbot.js
    Preparing search index...

    Class VoiceChannel

    Represents a voice channel in a server.

    Hierarchy (View Summary)

    Index

    Constructors

    • Creates a new VoiceChannel instance.

      Parameters

      • client: client

        The client instance.

      • data: {
            _id: string;
            channel_type: "VoiceChannel";
            default_permissions?: null | { a: number; d: number };
            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;
                };
            name: string;
            nsfw?: boolean;
            role_permissions?: { [key: string]: { a: number; d: number } };
            server: string;
        }

        The raw data for the voice channel from the API.

        • _id: string

          Unique Id

        • channel_type: "VoiceChannel"
        • Optionaldefault_permissions?: null | { a: number; d: number }

          Default permissions assigned to users in this channel

        • 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

        • name: string

          Display name of the channel

        • Optionalnsfw?: boolean

          Whether this channel is marked as not safe for work

        • Optionalrole_permissions?: { [key: string]: { a: number; d: number } }

          Permissions assigned based on role to this channel

        • server: string

          Id of the server this channel belongs to

      Returns VoiceChannel

    Properties

    client: client

    The client instance.

    description: null | string = null

    The description of the channel, or null if none is set.

    icon: null | Attachment = null

    The icon of the channel, or null if none is set.

    id: string

    The unique identifier for the object.

    name: string

    The name of the channel.

    nsfw: boolean = false

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

    overwrites: Map<string, Overwrite> = ...

    The permission overwrites for the channel.

    serverId: string

    The ID of the server this channel belongs to.

    type: VOICE = ChannelTypes.VOICE

    The type of the channel, which is always VOICE for voice channels.

    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.');
      }