From 490916a1ca25834634d83fbe0b6122855730cd16 Mon Sep 17 00:00:00 2001 From: Ave Date: Tue, 13 Oct 2020 17:37:13 +0300 Subject: [PATCH] yubicootp: Limit to one OTP per message --- cogs/yubicootp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cogs/yubicootp.py b/cogs/yubicootp.py index 22608d7..6af9ee8 100644 --- a/cogs/yubicootp.py +++ b/cogs/yubicootp.py @@ -94,8 +94,8 @@ class YubicoOTP(Cog): async def on_message(self, message): await self.bot.wait_until_ready() otps = self.otp_re.findall(message.content.strip()) - for otp_entry in otps: - otp = otp_entry[0] + if otps: + otp = otps[0][0] # Validate OTP validation_result = await self.validate_yubico_otp(otp) if validation_result is not True: