better saving

This commit is contained in:
AF 2022-11-08 05:14:39 +00:00
parent b3601bfbf3
commit 7fe4ce0e23
3 changed files with 4 additions and 2 deletions

View File

@ -124,7 +124,6 @@ class QueueAudio(discord.AudioSource):
return stream.getvalue()
def cleanup(self):
self.queue.clear()
for audio in self.queue:
try:
audio.cleanup()

View File

@ -12,6 +12,8 @@ from v6d3music.utils.tor_prefix import tor_prefix
adaas_available = bool(os.getenv('adaasurl'))
if adaas_available:
print('running real_url through adaas')
async def real_url(url: str, override: bool, tor: bool) -> str:

View File

@ -28,11 +28,12 @@ register_commands()
class MusicClient(discord.Client):
async def close(self) -> None:
save_task.cancel()
await super().close()
try:
await save_all(False, False)
print('saved')
except Exception:
traceback.print_exc()
await super().close()
client = MusicClient(
intents=discord.Intents(