[Audio] Stop player before destroying on emptydisconnect (#3119)

* fix(audio): stop player before disconnect in emptydisconnect

* chore(changelog): add towncrier entry
This commit is contained in:
jack1142 2019-11-14 19:05:48 +01:00 committed by Michael H
parent 6aeca83c63
commit 19e8e60a4d
2 changed files with 4 additions and 1 deletions

View File

@ -0,0 +1 @@
Bot's status is now properly cleared on emptydisconnect.

View File

@ -6740,7 +6740,9 @@ class Audio(commands.Cog):
if (time.time() - stop_times[sid]) >= emptydc_timer: if (time.time() - stop_times[sid]) >= emptydc_timer:
stop_times.pop(sid) stop_times.pop(sid)
try: try:
await lavalink.get_player(sid).disconnect() player = lavalink.get_player(sid)
await player.stop()
await player.disconnect()
except Exception: except Exception:
log.error("Exception raised in Audio's emptydc_timer.", exc_info=True) log.error("Exception raised in Audio's emptydc_timer.", exc_info=True)
pass pass