The manager handling verification (generating, sending and verifying the user's code).

Export

VerificationManager

Type Parameters

Hierarchy

  • EventEmitter
    • VerificationManager

Constructors

Properties

Methods

Constructors

  • Creates an instance of VerificationManager.

    Type Parameters

    Parameters

    • client: Client<boolean>
    • storingSystem: IStoringSystem<TUser>
    • senderAPI: ISenderAPI
    • Optional options: VerificationOptions<TUser> = ...

      An error occured when trying to send something to ${user?.username}! pendingMessage: (user: TUser) => The verification code has just been sent to ${user.data}., alreadyPendingMessage: (user: TUser) => You already have a verification code pending! It was sent to ${user.data}., alreadyActiveMessage: (user: TUser) => You are already verified with the email ${user.data}!, validCodeMessage: (user: TUser, validCode: string) => Your code ${validCode} is valid! Welcome ${user.username}!, invalidCodeMessage: (user: TUser, invalidCode: string) => Your code ${invalidCode} is invalid! }]

    Returns VerificationManager<TUser>

    Memberof

    VerificationManager

Properties

client: Client<boolean>

The Discord client instance.

Memberof

VerificationManager

Methods

  • Sends the code via the communication service to the user based on the provided data. Saves the user, their code and their data into the database.

    Parameters

    • userid: string
    • data: any

    Returns Promise<string>

    the result of the operation as a string, based on the result of the call to one of the manager's options' methods.

    Memberof

    VerificationManager

  • Verifies the provided code for the provided user. Increments the number of tries of that specific users.

    Parameters

    • userid: string
    • code: string

    Returns Promise<string>

    the result of the operation as a string, based on the result of the call to one of the manager's options' methods.

    Memberof

    VerificationManager