mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-08-11 05:52:12 +00:00
Ensure after is called inside the daemon thread for players.
This commit is contained in:
parent
e2de93e2a6
commit
dae3c66a54
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user