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