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

    Class VerificationManager<TUser>

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

    VerificationManager

    Type Parameters

    Hierarchy

    • EventEmitter
      • VerificationManager
    Index

    Constructors

    Properties

    Methods

    Constructors

    • Creates an instance of VerificationManager.

      Type Parameters

      Parameters

      • client: Client
      • storingSystem: IStoringSystem<TUser>
      • senderAPI: ISenderAPI
      • Optionaloptions: 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>

      VerificationManager

    Properties

    client: Client

    The Discord client instance.

    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.

      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.

      VerificationManager