mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-12-26 06:57:04 +01:00
JustDelete the message instead of iterating during guild remove
This commit is contained in:
parent
4859b5a379
commit
c35743b498
@ -152,9 +152,7 @@ class DatabaseInterface(object):
|
|||||||
with self.get_session() as session:
|
with self.get_session() as session:
|
||||||
gui = session.query(Guilds).filter(Guilds.guild_id == int(guild.id)).first()
|
gui = session.query(Guilds).filter(Guilds.guild_id == int(guild.id)).first()
|
||||||
if gui:
|
if gui:
|
||||||
dbmsgs = session.query(Messages).filter(Messages.guild_id == int(guild.id)).all()
|
dbmsgs = session.query(Messages).filter(Messages.guild_id == int(guild.id)).delete()
|
||||||
for msg in dbmsgs:
|
|
||||||
session.delete(msg)
|
|
||||||
session.delete(gui)
|
session.delete(gui)
|
||||||
session.commit()
|
session.commit()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user