mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-11-14 18:11:23 +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:
|
||||
gui = session.query(Guilds).filter(Guilds.guild_id == int(guild.id)).first()
|
||||
if gui:
|
||||
dbmsgs = session.query(Messages).filter(Messages.guild_id == int(guild.id)).all()
|
||||
for msg in dbmsgs:
|
||||
session.delete(msg)
|
||||
dbmsgs = session.query(Messages).filter(Messages.guild_id == int(guild.id)).delete()
|
||||
session.delete(gui)
|
||||
session.commit()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user