From ebcdfe82347108504b720be747c85b2a5ad61214 Mon Sep 17 00:00:00 2001 From: Paillat Date: Sun, 11 Dec 2022 00:34:05 +0100 Subject: [PATCH] Update chat.py --- code/cogs/chat.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/cogs/chat.py b/code/cogs/chat.py index 7c6ca08..f618412 100644 --- a/code/cogs/chat.py +++ b/code/cogs/chat.py @@ -41,8 +41,10 @@ class Chat (discord.Cog) : c.execute("SELECT uses_count_today FROM data WHERE guild_id = ?", (message.guild.id,)) uses = c.fetchone()[0] cp.execute("SELECT premium FROM data WHERE user_id = ? AND guild_id = ?", (message.author.id, message.guild.id)) - premium = cp.fetchone() - if c.fetchone()[0] >= 500 and premium is None: + + try: premium = cp.fetchone()[0] + except: premium = 0 + if c.fetchone()[0] >= 500 and premium == 0: debug(f"The bot has been used more than {max_uses} times in the last 24 hours in this guild. Please try again in 24h.") await message.channel.send("The bot has been used more than 500 times in the last 24 hours in this guild. Please try again in 24h.") return