mirror of
https://github.com/Paillat-dev/Botator.git
synced 2026-01-02 09:16:19 +00:00
refactor(setup.py): remove try-except block and simplify code for checking premium status of guild
This commit is contained in:
@@ -199,14 +199,10 @@ class Setup(discord.Cog):
|
|||||||
if curs_data.fetchone() is None:
|
if curs_data.fetchone() is None:
|
||||||
await ctx.respond("This server is not setup", ephemeral=True)
|
await ctx.respond("This server is not setup", ephemeral=True)
|
||||||
return
|
return
|
||||||
# check if the guild is premium
|
|
||||||
try:
|
|
||||||
con_premium.execute(
|
con_premium.execute(
|
||||||
"SELECT premium FROM data WHERE guild_id = ?", (ctx.guild.id,)
|
"SELECT premium FROM data WHERE guild_id = ?", (ctx.guild.id,)
|
||||||
)
|
)
|
||||||
premium = con_premium.fetchone()[0]
|
premium = con_premium.fetchone()[0]
|
||||||
except:
|
|
||||||
premium = 0
|
|
||||||
if not premium:
|
if not premium:
|
||||||
await ctx.respond("This server is not premium", ephemeral=True)
|
await ctx.respond("This server is not premium", ephemeral=True)
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user