@arg_botcmd('otp', type=int, template='otp_auth')
def otp_auth(self, message, otp=None):
    '\n\t\tAuthenticate with OTP to the bot to pass OTP filtering.\n\t\t'
    if message.is_group:
        return dict(group_chat=True)
    identity = self.get_identity(message)
    if (identity not in self['secrets']):
        return dict(not_enrolled=True)
    (secret, attempts, _) = self['secrets'][identity]
    totp = pyotp.TOTP(secret)
    if totp.verify(otp):
        with self.lock:
            with self.stored('secrets') as secrets:
                (secret, _, _) = secrets[identity]
                secrets[identity] = (secret, 0, datetime.datetime.now())
        return dict(success=True)
    else:
        with self.lock:
            with self.stored('secrets') as secrets:
                (secret, attempts, ts) = secrets[identity]
                if (attempts > self.config.get('max_retries')):
                    secret = ''
                secrets[identity] = (secret, (attempts + 1), ts)
    return dict(success=False)
Authenticate with OTP to the bot to pass OTP filtering.
@arg_botcmd('otp', type=int, template='otp_auth')
def otp_auth(self, message, otp=None):
    '\n\t\t\n\t\t'
    if message.is_group:
        return dict(group_chat=True)
    identity = self.get_identity(message)
    if (identity not in self['secrets']):
        return dict(not_enrolled=True)
    (secret, attempts, _) = self['secrets'][identity]
    totp = pyotp.TOTP(secret)
    if totp.verify(otp):
        with self.lock:
            with self.stored('secrets') as secrets:
                (secret, _, _) = secrets[identity]
                secrets[identity] = (secret, 0, datetime.datetime.now())
        return dict(success=True)
    else:
        with self.lock:
            with self.stored('secrets') as secrets:
                (secret, attempts, ts) = secrets[identity]
                if (attempts > self.config.get('max_retries')):
                    secret = 
                secrets[identity] = (secret, (attempts + 1), ts)
    return dict(success=False)