1
0
Fork 0
mirror of synced 2024-06-27 18:50:35 +12:00

Removed audio_tmp files upon startup of a music shard

This commit is contained in:
Phxntxm 2017-02-06 21:47:25 -06:00
parent 4e53b1f3a4
commit fae921995a

View file

@ -9,6 +9,7 @@ import time
import asyncio
import re
import os
import glob
import socket
if not discord.opus.is_loaded():
@ -122,6 +123,12 @@ class Music:
down = Downloader(download_folder='audio_tmp')
self.downloader = down
self.bot.downloader = down
self.clear_audio_tmp()
def clear_audio_tmp(self):
files = glob.glob('audio_tmp/*')
for f in files:
os.remove(f)
def get_voice_state(self, server):
state = self.voice_states.get(server.id)