diff --git a/vulkan/commands/Control.py b/vulkan/commands/Control.py index 14bf07a..3c96450 100644 --- a/vulkan/commands/Control.py +++ b/vulkan/commands/Control.py @@ -105,7 +105,7 @@ class Control(commands.Cog): @commands.command(name='invite', help=help.HELP_INVITE, description=help.HELP_INVITE_LONG) async def invite_bot(self, ctx): - invite_url = 'https://discordapp.com/oauth2/authorize?client_id={}&scope=bot>)'.format( + invite_url = 'https://discordapp.com/oauth2/authorize?client_id={}&scope=bot>'.format( self.__bot.user.id) txt = config.INVITE_MESSAGE.format(invite_url) diff --git a/vulkan/music/Player.py b/vulkan/music/Player.py index 1d70a34..f94d144 100644 --- a/vulkan/music/Player.py +++ b/vulkan/music/Player.py @@ -279,6 +279,14 @@ class Player(commands.Cog): self.__playlist.clear() async def now_playing(self) -> discord.Embed: + if not self.__playing: + embed = discord.Embed( + title=config.SONG_PLAYER, + description=config.PLAYER_NOT_PLAYING, + colour=config.COLOURS['blue'] + ) + return embed + if self.__playlist.looping_one: title = config.ONE_SONG_LOOPING else: @@ -300,6 +308,9 @@ class Player(commands.Cog): return config.ERROR_SHUFFLING async def move(self, pos1, pos2='1') -> str: + if not self.__playing: + return config.PLAYER_NOT_PLAYING + try: pos1 = int(pos1) pos2 = int(pos2) @@ -315,6 +326,9 @@ class Player(commands.Cog): async def remove(self, position) -> str: """Remove a song from the queue in the position""" + if not self.__playing: + return config.PLAYER_NOT_PLAYING + try: position = int(position) diff --git a/vulkan/music/utils.py b/vulkan/music/utils.py index 7211eb0..8faed81 100644 --- a/vulkan/music/utils.py +++ b/vulkan/music/utils.py @@ -6,7 +6,11 @@ from config import config def is_connected(ctx): try: voice_channel = ctx.guild.voice_client.channel - return voice_channel + + if not ctx.guild.voice_client.is_connected(): + return None + else: + return voice_channel except: return None