Stopped the player from resetting volume upon playing the next song
This commit is contained in:
parent
ffbd1ee431
commit
98d56f9b69
1 changed files with 3 additions and 0 deletions
|
@ -73,6 +73,7 @@ class VoiceState:
|
||||||
'default_search': 'auto',
|
'default_search': 'auto',
|
||||||
'quiet': True
|
'quiet': True
|
||||||
}
|
}
|
||||||
|
self.volume = 50
|
||||||
|
|
||||||
def is_playing(self):
|
def is_playing(self):
|
||||||
# If our VoiceClient or current VoiceEntry do not exist, then we are not playing a song
|
# If our VoiceClient or current VoiceEntry do not exist, then we are not playing a song
|
||||||
|
@ -123,6 +124,7 @@ class VoiceState:
|
||||||
after=self.toggle_next)
|
after=self.toggle_next)
|
||||||
# Now we can start actually playing the song
|
# Now we can start actually playing the song
|
||||||
self.current.player.start()
|
self.current.player.start()
|
||||||
|
self.current.player.volume = self.volume / 100
|
||||||
# Wait till the Event has been set, before doing our task again
|
# Wait till the Event has been set, before doing our task again
|
||||||
await self.play_next_song.wait()
|
await self.play_next_song.wait()
|
||||||
|
|
||||||
|
@ -309,6 +311,7 @@ class Music:
|
||||||
if value > 200:
|
if value > 200:
|
||||||
await self.bot.say("Sorry but the max volume is 200")
|
await self.bot.say("Sorry but the max volume is 200")
|
||||||
return
|
return
|
||||||
|
state.volume = value
|
||||||
if state.is_playing():
|
if state.is_playing():
|
||||||
player = state.player
|
player = state.player
|
||||||
player.volume = value / 100
|
player.volume = value / 100
|
||||||
|
|
Loading…
Reference in a new issue