fix: delete same file twice

This commit is contained in:
lanvent
2023-04-02 14:55:45 +08:00
parent cf25bd7869
commit 388058467c
2 changed files with 6 additions and 3 deletions

View File

@@ -84,7 +84,8 @@ class WechatyChannel(ChatChannel):
asyncio.run_coroutine_threadsafe(receiver.say(msg),loop).result()
try:
os.remove(file_path)
os.remove(sil_file)
if sil_file != file_path:
os.remove(sil_file)
except Exception as e:
pass
logger.info('[WX] sendVoice={}, receiver={}'.format(reply.content, receiver))