Type Alias AbstractRESTClient

AbstractRESTClient: {
    checkCommandsSynced: (
        guildId: string | null,
    ) => Promise<CommandCheckResponse>;
    clearCommands: (guildId?: string | null) => Promise<void>;
    data: APICommandData[];
    fetchApiCommands: (
        guildId: string | null,
    ) => Promise<
        Collection<string, ApplicationCommand<{ guild: GuildResolvable }>>,
    >;
    syncCommands: (
        components: Collection<string, NonAPICommand>,
        options?: SyncCommandOptions,
    ) => Promise<void>;
    syncCommandsToDatabase: (
        guildId: string | null,
        commandData: APICommandData[],
        diff: CommandCheckResponse,
    ) => Promise<void>;
}

Type declaration

  • checkCommandsSynced: (guildId: string | null) => Promise<CommandCheckResponse>

    Checks if local commands are in sync with the database & Discord API

  • clearCommands: (guildId?: string | null) => Promise<void>

    Clears commands from the Discord API

  • data: APICommandData[]

    Data for all commands that the client has registered

  • fetchApiCommands: (
        guildId: string | null,
    ) => Promise<
        Collection<string, ApplicationCommand<{ guild: GuildResolvable }>>,
    >

    Fetches commands from the Discord API

  • syncCommands: (
        components: Collection<string, NonAPICommand>,
        options?: SyncCommandOptions,
    ) => Promise<void>

    Syncs commands to the Discord API and our database. An API call is only made if there are new, updated, or deleted commands.

  • syncCommandsToDatabase: (
        guildId: string | null,
        commandData: APICommandData[],
        diff: CommandCheckResponse,
    ) => Promise<void>

    Syncs the local commands to the database