From 0bcb1452d5f088d7494523f75d3ab26554cb7654 Mon Sep 17 00:00:00 2001 From: CAG2Mark Date: Sun, 28 Apr 2024 23:41:43 +0800 Subject: [PATCH] fix bug --- bot.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bot.py b/bot.py index e4e96ed..f74edbe 100644 --- a/bot.py +++ b/bot.py @@ -60,7 +60,9 @@ class Bot: pw_bytes = password.encode('utf-8') del password pw_hash = self.data.get_user_password_hashsalt(inter.guild_id, inter.user.id) - pw_hash_bytes = bytes.fromhex(self.data.get_user_password_hashsalt(inter.guild_id, inter.user.id)) + + if pw_hash: + pw_hash_bytes = bytes.fromhex(self.data.get_user_password_hashsalt(inter.guild_id, inter.user.id)) if not pw_hash or bcrypt.checkpw(pw_bytes, pw_hash_bytes): sudoer_role = self.data.get_guild_sudoer_role(inter.guild_id)