mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-12-24 14:07:03 +01:00
Fixes to cleanup and fetch scripts
This commit is contained in:
parent
91f926bfe3
commit
495a08ea12
@ -89,7 +89,7 @@ class Titan(discord.Client):
|
||||
d = session.query(Messages).filter(Messages.channel_id == chanid, ~Messages.id.in_(keep_these)).delete(synchronize_session=False)
|
||||
session.commit()
|
||||
print(" --{} [{}]".format(channel["name"], d))
|
||||
d = session.query(Messages).filter(~Messages.channel_id.in_(active_channels)).delete(synchronize_session=False)
|
||||
d = session.query(Messages).filter(Messages.guild_id == guild.id, ~Messages.channel_id.in_(active_channels)).delete(synchronize_session=False)
|
||||
session.commit()
|
||||
print(" INACTIVE {}".format(d))
|
||||
print("done!")
|
||||
|
@ -69,10 +69,13 @@ class Titan(discord.Client):
|
||||
|
||||
print("working on this...")
|
||||
for channel in self.get_all_channels():
|
||||
try:
|
||||
if str(channel.type) == "text":
|
||||
print("Processing channel: ID-{} Name-'{}' ServerID-{} Server-'{}'".format(channel.id, channel.name, channel.server.id, channel.server.name))
|
||||
async for message in self.logs_from(channel, limit=50, reverse=True):
|
||||
await self.database.push_message(message)
|
||||
except:
|
||||
continue
|
||||
print("done!")
|
||||
await self.logout()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user