diff --git a/Dockerfile b/Dockerfile index 3054fb3..5ca757f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ ENV PYTHONUNBUFFERED=1 COPY requirements.txt . RUN pip install -r requirements.txt RUN git clone https://github.com/Paillat-dev/Botator.git -WORKDIR /Botator/code/ +WORKDIR /Botator/ # Creates a non-root user with an explicit UID and adds permission to access the /app folder RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /Botator/code USER appuser diff --git a/src/cogs/setup.py b/src/cogs/setup.py index 06dac23..a03e2b4 100644 --- a/src/cogs/setup.py +++ b/src/cogs/setup.py @@ -194,19 +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 - # check if the guild is premium try: - con_premium.execute( + curs_premium.execute( "SELECT premium FROM data WHERE guild_id = ?", (ctx.guild.id,) ) - premium = con_premium.fetchone()[0] + premium = curs_premium.fetchone()[0] except: - premium = 0 + premium = False if not premium: await ctx.respond("This server is not premium", ephemeral=True) return @@ -221,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( @@ -240,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), )