1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00

publish: 5.6.10

This commit is contained in:
Steffo 2020-03-30 01:33:07 +02:00
parent 0c6531f7b7
commit ca5b362cf2
5 changed files with 27 additions and 6 deletions

View file

@ -2,7 +2,7 @@
[tool.poetry]
name = "royalpack"
version = "5.6.9"
version = "5.6.10"
description = "A Royalnet command pack for the Royal Games community"
authors = ["Stefano Pigozzi <ste.pigozzi@gmail.com>"]
license = "AGPL-3.0+"

View file

@ -6,7 +6,7 @@ import royalnet.commands as rc
import royalnet.serf.discord as rsd
import royalnet.bard.discord as rbd
from ..utils import RoyalQueue
from ..utils import RoyalQueue, RoyalPool
class DiscordLazyPlayEvent(rc.Event):
@ -49,6 +49,16 @@ class DiscordLazyPlayEvent(rc.Event):
voice_player.playing.contents.append(ytd)
if not voice_player.voice_client.is_playing():
await voice_player.start()
elif isinstance(voice_player.playing, RoyalPool):
for index, ytd in enumerate(ytds):
if ytd.info.duration >= datetime.timedelta(seconds=self.config["Play"]["max_song_duration"]):
too_long.append(ytd)
continue
added.append(ytd)
voice_player.playing.full_pool.append(ytd)
voice_player.playing.remaining_pool.append(ytd)
if not voice_player.voice_client.is_playing():
await voice_player.start()
else:
raise rc.CommandError(f"Non so come aggiungere musica a [c]{voice_player.playing.__class__.__qualname__}[/c]!")

View file

@ -6,7 +6,7 @@ import royalnet.commands as rc
import royalnet.serf.discord as rsd
import royalnet.bard.discord as rbd
from ..utils import RoyalQueue
from ..utils import RoyalQueue, RoyalPool
class DiscordPlayEvent(rc.Event):
@ -50,6 +50,17 @@ class DiscordPlayEvent(rc.Event):
voice_player.playing.contents.append(ytd)
if not voice_player.voice_client.is_playing():
await voice_player.start()
elif isinstance(voice_player.playing, RoyalPool):
for index, ytd in enumerate(ytds):
if ytd.info.duration >= datetime.timedelta(seconds=self.config["Play"]["max_song_duration"]):
too_long.append(ytd)
continue
await ytd.convert_to_pcm()
added.append(ytd)
voice_player.playing.full_pool.append(ytd)
voice_player.playing.remaining_pool.append(ytd)
if not voice_player.voice_client.is_playing():
await voice_player.start()
else:
raise rc.CommandError(f"Non so come aggiungere musica a [c]{voice_player.playing.__class__.__qualname__}[/c]!")

View file

@ -35,9 +35,9 @@ class DiscordPlaymodeEvent(rc.Event):
"Invia il comando su Discord, per favore!")
if playable_string.upper() == "QUEUE":
playable = RoyalQueue()
playable = await RoyalQueue.create()
elif playable_string.upper() == "POOL":
playable = RoyalPool()
playable = await RoyalPool.create()
else:
raise rc.InvalidInputError(f"Unknown playable '{playable_string.upper()}'")

View file

@ -1 +1 @@
semantic = "5.6.9"
semantic = "5.6.10"