Finish fixing lint smells in loops directory.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
from nextcord.ext import commands, tasks
|
||||
from sqlalchemy import select
|
||||
from sqlalchemy.orm import Session
|
||||
from sqlmodel import col
|
||||
|
||||
from database.db import engine
|
||||
from database.models import Guild
|
||||
@@ -11,7 +12,7 @@ from database.models import Guild
|
||||
class GuildData(commands.Cog, name="Guild Data"):
|
||||
"""Class to contain loop."""
|
||||
|
||||
def __init__(self, bot: commands.bot) -> None:
|
||||
def __init__(self, bot: commands.Bot) -> None:
|
||||
self.bot = bot
|
||||
|
||||
@commands.Cog.listener()
|
||||
@@ -30,7 +31,7 @@ class GuildData(commands.Cog, name="Guild Data"):
|
||||
with Session(engine) as session:
|
||||
for guild in self.bot.guilds:
|
||||
# update given guild name for guild id
|
||||
stmt = select(Guild).where(Guild.id == guild.id)
|
||||
stmt = select(Guild).where(col(Guild.id == guild.id))
|
||||
guild_data = session.scalar(stmt)
|
||||
|
||||
# just in case checking if the guild doesn't exist.
|
||||
|
||||
Reference in New Issue
Block a user