Cleanup cache fix

This commit is contained in:
Twentysix 2016-02-15 09:37:04 +01:00
parent 3b04a82519
commit e54b80b3c9
2 changed files with 4 additions and 2 deletions

View File

@ -391,7 +391,10 @@ class Audio:
def empty_cache(self): def empty_cache(self):
files = os.listdir("data/audio/cache") files = os.listdir("data/audio/cache")
for f in files: for f in files:
try:
os.unlink("data/audio/cache/" + f) os.unlink("data/audio/cache/" + f)
except PermissionError: # In case it tries to delete the file that it's currently playing
pass
def cache_size(self): def cache_size(self):
total = [os.path.getsize("data/audio/cache/" + f) for f in os.listdir("data/audio/cache")] total = [os.path.getsize("data/audio/cache/" + f) for f in os.listdir("data/audio/cache")]

View File

@ -202,7 +202,6 @@ class General:
Usage example: Usage example:
poll Is this a poll?;Yes;No;Maybe""" poll Is this a poll?;Yes;No;Maybe"""
message = ctx.message message = ctx.message
print(text)
if len(text) == 1: if len(text) == 1:
if text[0].lower() == "stop": if text[0].lower() == "stop":
await self.endpoll(message) await self.endpoll(message)