mirror of
https://github.com/Paillat-dev/Botator.git
synced 2026-01-02 09:16:19 +00:00
FIXED THINGS
This commit is contained in:
@@ -194,15 +194,17 @@ class Setup(discord.Cog):
|
||||
async def add_channel(
|
||||
self, ctx: discord.ApplicationContext, channel: discord.TextChannel = None
|
||||
):
|
||||
# check if the guild is in the database
|
||||
curs_data.execute("SELECT * FROM data WHERE guild_id = ?", (ctx.guild.id,))
|
||||
if curs_data.fetchone() is None:
|
||||
await ctx.respond("This server is not setup", ephemeral=True)
|
||||
return
|
||||
con_premium.execute(
|
||||
"SELECT premium FROM data WHERE guild_id = ?", (ctx.guild.id,)
|
||||
)
|
||||
premium = curs_premium.fetchone()[0]
|
||||
try:
|
||||
curs_premium.execute(
|
||||
"SELECT premium FROM data WHERE guild_id = ?", (ctx.guild.id,)
|
||||
)
|
||||
premium = curs_premium.fetchone()[0]
|
||||
except:
|
||||
premium = False
|
||||
if not premium:
|
||||
await ctx.respond("This server is not premium", ephemeral=True)
|
||||
return
|
||||
@@ -217,10 +219,10 @@ class Setup(discord.Cog):
|
||||
"This channel is already set as the main channel", ephemeral=True
|
||||
)
|
||||
return
|
||||
con_premium.execute(
|
||||
curs_premium.execute(
|
||||
"SELECT * FROM channels WHERE guild_id = ?", (ctx.guild.id,)
|
||||
)
|
||||
guild_channels = con_premium.fetchone()
|
||||
guild_channels = curs_premium.fetchone()
|
||||
if guild_channels is None:
|
||||
# if the channel is not in the list, add it
|
||||
con_premium.execute(
|
||||
@@ -236,7 +238,7 @@ class Setup(discord.Cog):
|
||||
return
|
||||
for i in range(5):
|
||||
if channels[i] == None:
|
||||
con_premium.execute(
|
||||
curs_premium.execute(
|
||||
f"UPDATE channels SET channel{i} = ? WHERE guild_id = ?",
|
||||
(channel.id, ctx.guild.id),
|
||||
)
|
||||
|
||||
@@ -58,7 +58,7 @@ def get_guild_data(message):
|
||||
guild_data = {}
|
||||
guid = mg_to_guid(message)
|
||||
try:
|
||||
con_premium.execute(
|
||||
curs_premium.execute(
|
||||
"SELECT * FROM data WHERE guild_id = ?", (guid,)
|
||||
) # get the data of the guild
|
||||
except:
|
||||
|
||||
Reference in New Issue
Block a user