mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-07 11:48:55 -05:00
[Audio] Disallow seek during active vote (#2290)
Users were able to use seek to skip songs while voteskip was active. This change prevents users from doing so.
This commit is contained in:
parent
8abb24bc01
commit
bbccb671b8
@ -1983,6 +1983,7 @@ class Audio(commands.Cog):
|
|||||||
async def seek(self, ctx, seconds: int = 30):
|
async def seek(self, ctx, seconds: int = 30):
|
||||||
"""Seek ahead or behind on a track by seconds."""
|
"""Seek ahead or behind on a track by seconds."""
|
||||||
dj_enabled = await self.config.guild(ctx.guild).dj_enabled()
|
dj_enabled = await self.config.guild(ctx.guild).dj_enabled()
|
||||||
|
vote_enabled = await self.config.guild(ctx.guild).vote_enabled()
|
||||||
if not self._player_check(ctx):
|
if not self._player_check(ctx):
|
||||||
return await self._embed_msg(ctx, _("Nothing playing."))
|
return await self._embed_msg(ctx, _("Nothing playing."))
|
||||||
player = lavalink.get_player(ctx.guild.id)
|
player = lavalink.get_player(ctx.guild.id)
|
||||||
@ -1995,6 +1996,13 @@ class Audio(commands.Cog):
|
|||||||
ctx, ctx.author
|
ctx, ctx.author
|
||||||
):
|
):
|
||||||
return await self._embed_msg(ctx, _("You need the DJ role to use seek."))
|
return await self._embed_msg(ctx, _("You need the DJ role to use seek."))
|
||||||
|
if vote_enabled:
|
||||||
|
if not await self._can_instaskip(ctx, ctx.author) and not await self._is_alone(
|
||||||
|
ctx, ctx.author
|
||||||
|
):
|
||||||
|
return await self._embed_msg(
|
||||||
|
ctx, _("There are other people listening - vote to skip instead.")
|
||||||
|
)
|
||||||
if player.current:
|
if player.current:
|
||||||
if player.current.is_stream:
|
if player.current.is_stream:
|
||||||
return await self._embed_msg(ctx, _("Can't seek on a stream."))
|
return await self._embed_msg(ctx, _("Can't seek on a stream."))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user