yubicootp: Limit to one OTP per message

This commit is contained in:
Ave 2020-10-13 17:37:13 +03:00
parent 8d1ef828f0
commit 490916a1ca
No known key found for this signature in database
GPG key ID: 398DD7BD03276F6D

View file

@ -94,8 +94,8 @@ class YubicoOTP(Cog):
async def on_message(self, message): async def on_message(self, message):
await self.bot.wait_until_ready() await self.bot.wait_until_ready()
otps = self.otp_re.findall(message.content.strip()) otps = self.otp_re.findall(message.content.strip())
for otp_entry in otps: if otps:
otp = otp_entry[0] otp = otps[0][0]
# Validate OTP # Validate OTP
validation_result = await self.validate_yubico_otp(otp) validation_result = await self.validate_yubico_otp(otp)
if validation_result is not True: if validation_result is not True: