revbot.js
    Preparing search index...

    Class ChannelCreate

    Represents the event handler for channel creation.

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Handles the channel creation event.

      Parameters

      • data:
            | { _id: string; channel_type: "SavedMessages"; user: string }
            | {
                _id: string;
                active: boolean;
                channel_type: "DirectMessage";
                last_message_id?: null | string;
                recipients: string[];
            }
            | {
                _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[];
            }
            | {
                _id: string;
                channel_type: "TextChannel";
                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;
                    };
                last_message_id?: null
                | string;
                name: string;
                nsfw?: boolean;
                role_permissions?: { [key: string]: { a: number; d: number } };
                server: string;
            }
            | {
                _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 created channel from the API.

        • { _id: string; channel_type: "SavedMessages"; user: string }
          • _id: string

            Unique Id

          • channel_type: "SavedMessages"
          • user: string

            Id of the user this channel belongs to

        • {
              _id: string;
              active: boolean;
              channel_type: "DirectMessage";
              last_message_id?: null | string;
              recipients: string[];
          }
          • _id: string

            Unique Id

          • active: boolean

            Whether this direct message channel is currently open on both sides

          • channel_type: "DirectMessage"
          • Optionallast_message_id?: null | string

            Id of the last message sent in this channel

          • recipients: string[]

            2-tuple of user ids participating in direct message

        • {
              _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[];
          }
          • _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

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

            Unique Id

          • channel_type: "TextChannel"
          • 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

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

        • {
              _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;
          }
          • _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 Promise<unknown>

      A promise that resolves with the created channel.