@hunteroi/discord-verification
    Preparing search index...

    Interface VerificationOptions<TUser>

    The VerificationManager options.

    VerificationOptions

    interface VerificationOptions<TUser extends IUser> {
        codeGenerationOptions: { charactersWhitelist?: string; length: number };
        maxNbCodeCalledBeforeResend: number;
        alreadyActiveMessage(user: TUser): string;
        alreadyPendingMessage(user: TUser): string;
        errorMessage(user: TUser, error: unknown): string;
        invalidCodeMessage(
            user: undefined | null | TUser,
            invalidCode: string,
        ): string;
        pendingMessage(user: TUser): string;
        validCodeMessage(user: undefined | null | TUser, validCode: string): string;
    }

    Type Parameters

    Index

    Properties

    codeGenerationOptions: { charactersWhitelist?: string; length: number }

    The options related to the code generation.

    Type Declaration

    • OptionalcharactersWhitelist?: string

      The whitelist of characters used to generate the code.

    • length: number

      The required length of the code.

    VerificationOptions

    maxNbCodeCalledBeforeResend: number

    The maximum number of calls before resending the code to the user via the communication service.

    VerificationOptions

    Methods

    • Formats the message sent once the user tries to generate a code when they are already verified.

      Parameters

      Returns string

      the message

      VerificationOptions

    • Formats the message sent once the user tries to generate a code when it's already sent to them.

      Parameters

      Returns string

      the message

      VerificationOptions

    • Formats the message sent when calling the communication service throws an error.

      Parameters

      • user: TUser
      • error: unknown

      Returns string

      the message

      VerificationOptions

    • Formats the message sent once the code is checked and invalid.

      Parameters

      • user: undefined | null | TUser
      • invalidCode: string

      Returns string

      the message

      VerificationOptions

    • Formats the message sent for the first time when the user's code has just been sent.

      Parameters

      Returns string

      the message

      VerificationOptions

    • Formats the message sent once the code is checked and valid.

      Parameters

      • user: undefined | null | TUser
      • validCode: string

      Returns string

      the message

      VerificationOptions