Stability Update

This commit is contained in:
Rafael Vargas 2022-01-12 10:41:31 -04:00
parent 5b4c5b49f1
commit 173b6a7b43
3 changed files with 20 additions and 2 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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