refactor(setup.py): remove try-except block and simplify code for checking premium status of guild

This commit is contained in:
Paillat
2023-05-05 13:13:49 +02:00
parent ca85067d70
commit 205f1f5b3e

View File

@@ -199,14 +199,10 @@ class Setup(discord.Cog):
if curs_data.fetchone() is None:
await ctx.respond("This server is not setup", ephemeral=True)
return
# check if the guild is premium
try:
con_premium.execute(
"SELECT premium FROM data WHERE guild_id = ?", (ctx.guild.id,)
)
premium = con_premium.fetchone()[0]
except:
premium = 0
if not premium:
await ctx.respond("This server is not premium", ephemeral=True)
return