rename variable.
This commit is contained in:
@@ -36,13 +36,13 @@ class GuildData(commands.Cog, name="Guild Data"):
|
|||||||
for guild in self.bot.guilds:
|
for guild in self.bot.guilds:
|
||||||
# update given guild name for guild id
|
# update given guild name for guild id
|
||||||
stmt = select(Guild).where(Guild.GuildId == guild.id)
|
stmt = select(Guild).where(Guild.GuildId == guild.id)
|
||||||
g = session.scalar(stmt)
|
guild_data = session.scalar(stmt)
|
||||||
|
|
||||||
# just in case checking if the guild doesn't exist.
|
# just in case checking if the guild doesn't exist.
|
||||||
if g is None:
|
if guild_data is None:
|
||||||
new_guild = Guild(GuildId=guild.id, GuildName=guild.name)
|
new_guild = Guild(GuildId=guild.id, GuildName=guild.name)
|
||||||
session.add(new_guild)
|
session.add(new_guild)
|
||||||
else:
|
else:
|
||||||
g.GuildName = guild.name
|
guild_data.GuildName = guild.name
|
||||||
|
|
||||||
session.commit()
|
session.commit()
|
||||||
|
|||||||
Reference in New Issue
Block a user