mirror of
				https://github.com/TitanEmbeds/Titan.git
				synced 2025-11-04 07:47:10 +01:00 
			
		
		
		
	Clear bufferarray on error too
This commit is contained in:
		@@ -205,9 +205,13 @@ class Titan(discord.AutoShardedClient):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            if len(msg) >= 4:
 | 
					            if len(msg) >= 4:
 | 
				
			||||||
                if msg[-4:] == b'\x00\x00\xff\xff':
 | 
					                if msg[-4:] == b'\x00\x00\xff\xff':
 | 
				
			||||||
                    msg = self.zlib_obj.decompress(self.buffer_arr)
 | 
					                    try:
 | 
				
			||||||
                    msg = msg.decode('utf-8')
 | 
					                        msg = self.zlib_obj.decompress(self.buffer_arr)
 | 
				
			||||||
                    self.buffer_arr = bytearray()
 | 
					                        msg = msg.decode('utf-8')
 | 
				
			||||||
 | 
					                    except:
 | 
				
			||||||
 | 
					                        return
 | 
				
			||||||
 | 
					                    finally:
 | 
				
			||||||
 | 
					                        self.buffer_arr = bytearray()
 | 
				
			||||||
                else:
 | 
					                else:
 | 
				
			||||||
                    return
 | 
					                    return
 | 
				
			||||||
            else:
 | 
					            else:
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user