mysendhidden everywhere
This commit is contained in:
parent
d4ed846cb5
commit
c0aa999cbd
1 changed files with 20 additions and 28 deletions
|
@ -475,8 +475,7 @@ class Music(commands.Cog, wavelink.WavelinkMixin):
|
||||||
player: Player = self.bot.wavelink.get_player(guild_id=ctx.guild.id, cls=Player, context=ctx)
|
player: Player = self.bot.wavelink.get_player(guild_id=ctx.guild.id, cls=Player, context=ctx)
|
||||||
|
|
||||||
if player.is_connected:
|
if player.is_connected:
|
||||||
if fromSlash:
|
mySendHidden(ctx, fromSlash, "Déjà connecté.")
|
||||||
await ctx.send("Déjà connecté.", hidden = True)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
channel = getattr(ctx.author.voice, 'channel', channel)
|
channel = getattr(ctx.author.voice, 'channel', channel)
|
||||||
|
@ -500,7 +499,10 @@ class Music(commands.Cog, wavelink.WavelinkMixin):
|
||||||
player: Player = self.bot.wavelink.get_player(guild_id=ctx.guild.id, cls=Player, context=ctx)
|
player: Player = self.bot.wavelink.get_player(guild_id=ctx.guild.id, cls=Player, context=ctx)
|
||||||
|
|
||||||
if not player.is_connected:
|
if not player.is_connected:
|
||||||
|
try:
|
||||||
channel = getattr(ctx.author.voice, 'channel')
|
channel = getattr(ctx.author.voice, 'channel')
|
||||||
|
except:
|
||||||
|
return await mySendHidden(ctx, fromSlash, "Tu n'es connecté à aucun salon vocal.")
|
||||||
if channel is None:
|
if channel is None:
|
||||||
raise NoChannelProvided
|
raise NoChannelProvided
|
||||||
await self.connect(ctx = ctx, channel = channel, fromSlash = True)
|
await self.connect(ctx = ctx, channel = channel, fromSlash = True)
|
||||||
|
@ -539,8 +541,7 @@ class Music(commands.Cog, wavelink.WavelinkMixin):
|
||||||
player: Player = self.bot.wavelink.get_player(guild_id=ctx.guild.id, cls=Player, context=ctx)
|
player: Player = self.bot.wavelink.get_player(guild_id=ctx.guild.id, cls=Player, context=ctx)
|
||||||
|
|
||||||
if player.is_paused or not player.is_connected:
|
if player.is_paused or not player.is_connected:
|
||||||
if fromSlash:
|
await mySendHidden(ctx, fromSlash, "Aucune musique n'est en cours.")
|
||||||
await ctx.send("Aucune musique n'est en cours.", hidden = True)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.is_privileged(ctx):
|
if self.is_privileged(ctx):
|
||||||
|
@ -569,8 +570,7 @@ class Music(commands.Cog, wavelink.WavelinkMixin):
|
||||||
player: Player = self.bot.wavelink.get_player(guild_id=ctx.guild.id, cls=Player, context=ctx)
|
player: Player = self.bot.wavelink.get_player(guild_id=ctx.guild.id, cls=Player, context=ctx)
|
||||||
|
|
||||||
if not player.is_paused or not player.is_connected:
|
if not player.is_paused or not player.is_connected:
|
||||||
if fromSlash:
|
await mySendHidden(ctx, fromSlash, "Aucune musique en pause n'est en cours.")
|
||||||
await ctx.send("Aucune musique en pause n'est en cours.", hidden = True)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.is_privileged(ctx):
|
if self.is_privileged(ctx):
|
||||||
|
@ -599,8 +599,7 @@ class Music(commands.Cog, wavelink.WavelinkMixin):
|
||||||
player: Player = self.bot.wavelink.get_player(guild_id=ctx.guild.id, cls=Player, context=ctx)
|
player: Player = self.bot.wavelink.get_player(guild_id=ctx.guild.id, cls=Player, context=ctx)
|
||||||
|
|
||||||
if not player.is_connected:
|
if not player.is_connected:
|
||||||
if fromSlash:
|
await mySendHidden(ctx, fromSlash, "Aucune musique n'est en cours.")
|
||||||
await ctx.send("Aucune musique n'est en cours.", hidden = True)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.is_privileged(ctx) or ctx.author == player.current.requester:
|
if self.is_privileged(ctx) or ctx.author == player.current.requester:
|
||||||
|
@ -629,13 +628,11 @@ class Music(commands.Cog, wavelink.WavelinkMixin):
|
||||||
player: Player = self.bot.wavelink.get_player(guild_id=ctx.guild.id, cls=Player, context=ctx)
|
player: Player = self.bot.wavelink.get_player(guild_id=ctx.guild.id, cls=Player, context=ctx)
|
||||||
|
|
||||||
if not player.is_connected:
|
if not player.is_connected:
|
||||||
if fromSlash:
|
await mySendHidden(ctx, fromSlash, "Aucune musique n'est en cours.")
|
||||||
await ctx.send("Aucune musique n'est en cours.", hidden = True)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.is_privileged(ctx):
|
if self.is_privileged(ctx):
|
||||||
await ctx.send(f"{ctx.author.mention} a déconnecter le bot et supprimer la file d'attente.", delete_after=10)
|
await ctx.send(f"{ctx.author.mention} a déconnecter le bot et supprimer la file d'attente.", delete_after=10)
|
||||||
print("x")
|
|
||||||
return await player.teardown()
|
return await player.teardown()
|
||||||
|
|
||||||
required = self.required(ctx)
|
required = self.required(ctx)
|
||||||
|
@ -660,8 +657,7 @@ class Music(commands.Cog, wavelink.WavelinkMixin):
|
||||||
return await mySendHidden(ctx, fromSlash, f"Le volume est actuellement réglé à **{player.volume}%**.")
|
return await mySendHidden(ctx, fromSlash, f"Le volume est actuellement réglé à **{player.volume}%**.")
|
||||||
|
|
||||||
if not player.is_connected:
|
if not player.is_connected:
|
||||||
if fromSlash:
|
await mySendHidden(ctx, fromSlash, "Aucune musique n'est en cours.")
|
||||||
await ctx.send("Aucune musique n'est en cours.", hidden = True)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
if not self.is_privileged(ctx):
|
if not self.is_privileged(ctx):
|
||||||
|
@ -683,8 +679,7 @@ class Music(commands.Cog, wavelink.WavelinkMixin):
|
||||||
player: Player = self.bot.wavelink.get_player(guild_id=ctx.guild.id, cls=Player, context=ctx)
|
player: Player = self.bot.wavelink.get_player(guild_id=ctx.guild.id, cls=Player, context=ctx)
|
||||||
|
|
||||||
if not player.is_connected:
|
if not player.is_connected:
|
||||||
if fromSlash:
|
await mySendHidden(ctx, fromSlash, "Aucune musique n'est en cours.")
|
||||||
await ctx.send("Aucune musique n'est en cours.", hidden = True)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
if player.queue.qsize() < 3:
|
if player.queue.qsize() < 3:
|
||||||
|
@ -747,8 +742,7 @@ class Music(commands.Cog, wavelink.WavelinkMixin):
|
||||||
player: Player = self.bot.wavelink.get_player(guild_id=ctx.guild.id, cls=Player, context=ctx)
|
player: Player = self.bot.wavelink.get_player(guild_id=ctx.guild.id, cls=Player, context=ctx)
|
||||||
|
|
||||||
if not player.is_connected:
|
if not player.is_connected:
|
||||||
if fromSlash:
|
await mySendHidden(ctx, fromSlash, "Aucune musique n'est en cours.")
|
||||||
await ctx.send("Aucune musique n'est en cours.", hidden = True)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
if not self.is_privileged(ctx):
|
if not self.is_privileged(ctx):
|
||||||
|
@ -777,8 +771,7 @@ class Music(commands.Cog, wavelink.WavelinkMixin):
|
||||||
player: Player = self.bot.wavelink.get_player(guild_id=ctx.guild.id, cls=Player, context=ctx)
|
player: Player = self.bot.wavelink.get_player(guild_id=ctx.guild.id, cls=Player, context=ctx)
|
||||||
|
|
||||||
if not player.is_connected:
|
if not player.is_connected:
|
||||||
if fromSlash:
|
await mySendHidden(ctx, fromSlash, "Aucune musique n'est en cours.")
|
||||||
await ctx.send("Aucune musique n'est en cours.", hidden = True)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
if player.queue.qsize() == 0:
|
if player.queue.qsize() == 0:
|
||||||
|
@ -788,6 +781,7 @@ class Music(commands.Cog, wavelink.WavelinkMixin):
|
||||||
pages = PaginatorSource(entries=entries)
|
pages = PaginatorSource(entries=entries)
|
||||||
paginator = menus.MenuPages(source=pages, timeout=None, delete_message_after=True)
|
paginator = menus.MenuPages(source=pages, timeout=None, delete_message_after=True)
|
||||||
|
|
||||||
|
if fromSlash:
|
||||||
await ctx.send("Affichage de la liste ci-dessous.", hidden = True)
|
await ctx.send("Affichage de la liste ci-dessous.", hidden = True)
|
||||||
await paginator.start(ctx)
|
await paginator.start(ctx)
|
||||||
@cog_ext.cog_slash(name="queue", description = "Affiche les sons en attente.")
|
@cog_ext.cog_slash(name="queue", description = "Affiche les sons en attente.")
|
||||||
|
@ -801,8 +795,7 @@ class Music(commands.Cog, wavelink.WavelinkMixin):
|
||||||
player: Player = self.bot.wavelink.get_player(guild_id=ctx.guild.id, cls=Player, context=ctx)
|
player: Player = self.bot.wavelink.get_player(guild_id=ctx.guild.id, cls=Player, context=ctx)
|
||||||
|
|
||||||
if not player.is_connected:
|
if not player.is_connected:
|
||||||
if fromSlash:
|
await mySendHidden(ctx, fromSlash, "Aucune musique n'est en cours.")
|
||||||
await ctx.send("Aucune musique n'est en cours.", hidden = True)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
await player.invoke_controller()
|
await player.invoke_controller()
|
||||||
|
@ -819,8 +812,7 @@ class Music(commands.Cog, wavelink.WavelinkMixin):
|
||||||
player: Player = self.bot.wavelink.get_player(guild_id=ctx.guild.id, cls=Player, context=ctx)
|
player: Player = self.bot.wavelink.get_player(guild_id=ctx.guild.id, cls=Player, context=ctx)
|
||||||
|
|
||||||
if not player.is_connected:
|
if not player.is_connected:
|
||||||
if fromSlash:
|
await mySendHidden(ctx, fromSlash, "Aucune musique n'est en cours.")
|
||||||
await ctx.send("Aucune musique n'est en cours.", hidden = True)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
if not self.is_privileged(ctx):
|
if not self.is_privileged(ctx):
|
||||||
|
|
Reference in a new issue