aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2017-02-14 00:57:30 -0500
committerRapptz <[email protected]>2017-02-14 02:10:07 -0500
commit132ac45010edd5ac6c2648aafd1755d76026a14b (patch)
tree80dfc92a7981fabad6b62196e19134703266e87f
parent[commands] Add commands.clean_content converter. (diff)
downloaddiscord.py-132ac45010edd5ac6c2648aafd1755d76026a14b.tar.xz
discord.py-132ac45010edd5ac6c2648aafd1755d76026a14b.zip
Ensure after is called inside the daemon thread for players.
-rw-r--r--discord/voice_client.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/discord/voice_client.py b/discord/voice_client.py
index c126f297..75763794 100644
--- a/discord/voice_client.py
+++ b/discord/voice_client.py
@@ -118,9 +118,10 @@ class StreamPlayer(threading.Thread):
except Exception as e:
self._current_error = e
self.stop()
+ finally:
+ self._call_after()
- def stop(self):
- self._end.set()
+ def _call_after(self):
if self.after is not None:
try:
arg_count = len(inspect.signature(self.after).parameters)
@@ -136,6 +137,9 @@ class StreamPlayer(threading.Thread):
except:
pass
+ def stop(self):
+ self._end.set()
+
@property
def error(self):
return self._current_error