Hierarchy

Constructors

Properties

api: API
channels: ChannelManager
config: {
    app: string;
    build: {
        commit_sha: string;
        commit_timestamp: string;
        origin_url: string;
        semver: string;
        timestamp: string;
    };
    features: {
        autumn: {
            enabled: boolean;
            url: string;
        };
        captcha: {
            enabled: boolean;
            key: string;
        };
        email: boolean;
        invite_only: boolean;
        january: {
            enabled: boolean;
            url: string;
        };
        voso: {
            enabled: boolean;
            url: string;
            ws: string;
        };
    };
    revolt: string;
    vapid: string;
    ws: string;
}

Type declaration

  • app: string

    Description

    URL pointing to the client serving this node

  • build: {
        commit_sha: string;
        commit_timestamp: string;
        origin_url: string;
        semver: string;
        timestamp: string;
    }

    Description

    Build information

    • commit_sha: string

      Description

      Commit Hash

    • commit_timestamp: string

      Description

      Commit Timestamp

    • origin_url: string

      Description

      Git Origin URL

    • semver: string

      Description

      Git Semver

    • timestamp: string

      Description

      Build Timestamp

  • features: {
        autumn: {
            enabled: boolean;
            url: string;
        };
        captcha: {
            enabled: boolean;
            key: string;
        };
        email: boolean;
        invite_only: boolean;
        january: {
            enabled: boolean;
            url: string;
        };
        voso: {
            enabled: boolean;
            url: string;
            ws: string;
        };
    }

    Description

    Features enabled on this Revolt node

    • autumn: {
          enabled: boolean;
          url: string;
      }

      Description

      File server service configuration

      • enabled: boolean

        Description

        Whether the service is enabled

      • url: string

        Description

        URL pointing to the service

    • captcha: {
          enabled: boolean;
          key: string;
      }

      Description

      hCaptcha configuration

      • enabled: boolean

        Description

        Whether captcha is enabled

      • key: string

        Description

        Client key used for solving captcha

    • email: boolean

      Description

      Whether email verification is enabled

    • invite_only: boolean

      Description

      Whether this server is invite only

    • january: {
          enabled: boolean;
          url: string;
      }

      Description

      Proxy service configuration

      • enabled: boolean

        Description

        Whether the service is enabled

      • url: string

        Description

        URL pointing to the service

    • voso: {
          enabled: boolean;
          url: string;
          ws: string;
      }

      Description

      Voice server configuration

      • enabled: boolean

        Description

        Whether voice is enabled

      • url: string

        Description

        URL pointing to the voice API

      • ws: string

        Description

        URL pointing to the voice WebSocket server

  • revolt: string

    Description

    Revolt API Version

  • vapid: string

    Description

    Web Push VAPID public key

  • ws: string

    Description

    WebSocket URL

emojis: EmojiManager
options: ClientOptions
servers: ServerManager
session: ClientSession
unreads: UnreadManager
prefixed: string | boolean

Accessors

  • get mfa(): {
        allowedMethods(): Promise<("Password" | "Recovery" | "Totp")[]>;
        disableTOTP(ticketToken: string): Promise<void>;
        enableTOTP(ticketToken: string, totp_code: string): Promise<undefined>;
        fetchRecoveryCodes(ticketToken: string): Promise<string[]>;
        generateRecoveryCodes(ticketToken: string): Promise<string[]>;
        generateTOTPSecret(ticketToken: string): Promise<string>;
        generateTicket(code: {
            password: string;
        } | {
            recovery_code: string;
        } | {
            totp_code: string;
        }): Promise<{
            accountID: string;
            authorized: boolean;
            id: string;
            lastTOTPCode: string;
            token: string;
            validated: boolean;
        }>;
        status(): Promise<{
            hasRecovery: boolean;
        }>;
    }
  • Returns {
        allowedMethods(): Promise<("Password" | "Recovery" | "Totp")[]>;
        disableTOTP(ticketToken: string): Promise<void>;
        enableTOTP(ticketToken: string, totp_code: string): Promise<undefined>;
        fetchRecoveryCodes(ticketToken: string): Promise<string[]>;
        generateRecoveryCodes(ticketToken: string): Promise<string[]>;
        generateTOTPSecret(ticketToken: string): Promise<string>;
        generateTicket(code: {
            password: string;
        } | {
            recovery_code: string;
        } | {
            totp_code: string;
        }): Promise<{
            accountID: string;
            authorized: boolean;
            id: string;
            lastTOTPCode: string;
            token: string;
            validated: boolean;
        }>;
        status(): Promise<{
            hasRecovery: boolean;
        }>;
    }

    • allowedMethods:function
      • Allowed ticket methods for account.

        Returns Promise<("Password" | "Recovery" | "Totp")[]>

    • disableTOTP:function
      • Disable TOTP.

        Parameters

        • ticketToken: string

        Returns Promise<void>

    • enableTOTP:function
      • Enable TOTP with the code from MFA app.

        Parameters

        • ticketToken: string
        • totp_code: string

        Returns Promise<undefined>

    • fetchRecoveryCodes:function
      • Fetch recovery codes. (or generate/enable them if not enabled)

        Parameters

        • ticketToken: string

        Returns Promise<string[]>

    • generateRecoveryCodes:function
      • Generate new recovery codes.

        Parameters

        • ticketToken: string

        Returns Promise<string[]>

    • generateTOTPSecret:function
      • Generate the TOTP secret for MFA app.

        Parameters

        • ticketToken: string

        Returns Promise<string>

    • generateTicket:function
      • Generate an MFA ticket for later use.

        Parameters

        • code: {
              password: string;
          } | {
              recovery_code: string;
          } | {
              totp_code: string;
          }

        Returns Promise<{
            accountID: string;
            authorized: boolean;
            id: string;
            lastTOTPCode: string;
            token: string;
            validated: boolean;
        }>

    • status:function
      • MFA status.

        Returns Promise<{
            hasRecovery: boolean;
        }>

Methods

  • Log in with a username and password.

    Returns

    Returns a response being one of none, onboard, or mfa. Onboarding and MFA both require a response.

    Parameters

    • details: {
          email: string;
          friendly_name?: string;
          password: string;
      } | {
          friendly_name?: string;
          mfa_response?: {
              password: string;
          } | {
              recovery_code: string;
          } | {
              totp_code: string;
          };
          mfa_ticket: string;
      }

    Returns Promise<{
        type: "none";
    } | {
        type: "onboard";
        respond(username: string, loginAfterSuccess: boolean): Promise<void>;
    } | {
        methods: ("Password" | "Recovery" | "Totp")[];
        ticket: string;
        type: "mfa";
        respond(totp_code: string): Promise<{
            type: "none";
        } | {
            type: "onboard";
            respond(username: string, loginAfterSuccess: boolean): Promise<void>;
        } | ({ type: "mfa"; ticket: string; methods: ("Password" | "Recovery" | "Totp")[]; respond(totp_code: string): Promise<{ type: "none"; } | { type: "onboard"; respond(username: string, loginAfterSuccess: boolean): Promise<...>; } | ...>; })>;
    }>

  • Change the client User's username.

    Parameters

    • details: {
          password: string;
          username: string;
      }
      • password: string

        Description

        Current account password

      • username: string

        Description

        New username

    Returns Promise<User>

  • Create a new group.

    Parameters

    • data: {
          description?: string;
          name: string;
          nsfw?: boolean;
          users: string[];
      }
      • Optional description?: string

        Description

        Group description

      • name: string

        Description

        Group name

      • Optional nsfw?: boolean

        Description

        Whether this group is age-restricted

      • users: string[]

        Description

        Array of user IDs to add to the group

        Must be friends with these users.

    Returns Promise<Channel>

  • Create a new server.

    Parameters

    • data: {
          description?: string;
          name: string;
          nsfw?: boolean;
      }
      • Optional description?: string

        Description

        Server description

      • name: string

        Description

        Server name

      • Optional nsfw?: boolean

        Description

        Whether this server is age-restricted

    Returns Promise<Server>

  • Parameters

    • destroySession: boolean = false

    Returns Promise<void>

  • Edit the client User's profile information.

    Parameters

    • details: {
          avatar?: string;
          badges?: number;
          display_name?: string;
          flags?: number;
          profile?: {
              background?: string;
              content?: string;
          };
          remove?: ("Avatar" | "StatusText" | "StatusPresence" | "ProfileContent" | "ProfileBackground" | "DisplayName")[];
          status?: {
              presence?: "Online" | "Idle" | "Focus" | "Busy" | "Invisible";
              text?: string;
          };
      }
      • Optional avatar?: string

        Description

        Attachment Id for avatar

      • Optional badges?: number

        Format: int32

        Description

        Bitfield of user badges

      • Optional display_name?: string

        Description

        New display name

      • Optional flags?: number

        Format: int32

        Description

        Enum of user flags

      • Optional profile?: {
            background?: string;
            content?: string;
        }

        Description

        New user profile data

        This is applied as a partial.

        • Optional background?: string

          Description

          Attachment Id for background

        • Optional content?: string

          Description

          Text to set as user profile description

      • Optional remove?: ("Avatar" | "StatusText" | "StatusPresence" | "ProfileContent" | "ProfileBackground" | "DisplayName")[]

        Description

        Fields to remove from user object

      • Optional status?: {
            presence?: "Online" | "Idle" | "Focus" | "Busy" | "Invisible";
            text?: string;
        }

        Description

        New user status

        • Optional presence?: "Online" | "Idle" | "Focus" | "Busy" | "Invisible"

          Description

          Current presence option

        • Optional text?: string

          Description

          Custom status text

    Returns Promise<User>

  • Calls each of the listeners registered for a given event.

    Type Parameters

    Parameters

    Returns boolean

  • Return an array listing the events for which the emitter has registered listeners.

    Returns (keyof ClientEvents)[]

  • Parameters

    • force: boolean = false

    Returns Promise<void>

  • Return the number of listeners listening to a given event.

    Parameters

    Returns number

  • Return the listeners registered for a given event.

    Type Parameters

    Parameters

    • event: T

    Returns ((...args: ArgumentMap<ClientEvents>[Extract<T, keyof ClientEvents>]) => void)[]

  • Log in using an existing session or bot token.

    Parameters

    • token: string
    • type: "user" | "bot"
    • connect: boolean = true
    • Optional details: Partial<Omit<Omit<ClientSession, "token">, "type">>

    Returns Promise<void>

  • Proxies a file URL through january. (if enabled)

    Parameters

    • url: string

    Returns string

  • Remove all listeners, or those of the specified event.

    Parameters

    Returns Client

  • Remove the listeners of a given event.

    Type Parameters

    Parameters

    Returns Client

  • Compatibility layer. Do not use in prod.

    Parameters

    • keys: string[]

    Returns Promise<{
        [key: string]: [number, string];
    }>

  • Compatibility layer. Do not use in prod.

    Parameters

    • data: {
          [key: string]: object | string;
      }
      • [key: string]: object | string
    • Optional timestamp: number

    Returns Promise<void>

  • Upload an attachment to Autumn.

    Parameters

    Returns Promise<string>