[Fix] - Error msg in loop command error, colours update

This commit is contained in:
Rafael Vargas 2022-01-13 20:10:28 -04:00
parent b39e1f0216
commit c23d4c13cb
4 changed files with 24 additions and 10 deletions

View File

@ -57,7 +57,7 @@ ERROR_NUMBER = '❌ This command require a number'
ERROR_PLAYING = '❌ Error while playing songs'
COMMAND_NOT_FOUND = f'❌ Command not found, type {BOT_PREFIX}help to see all commands'
UNKNOWN_ERROR = f'❌ Unknown Error, if needed, use {BOT_PREFIX}reset to reset the player of your server'
ERROR_MISSING_ARGUMENTS = f'❌ Missing arguments in this function. Type {BOT_PREFIX}help to see all commands'
ERROR_MISSING_ARGUMENTS = f'❌ Missing arguments in this command. Type {BOT_PREFIX}help "command" to see more info about this command'
NOT_PREVIOUS = '❌ There is none previous song to play'
PLAYER_NOT_PLAYING = f'❌ No song playing. Use {BOT_PREFIX}play to start the player'
IMPOSSIBLE_MOVE = 'That is impossible :('
@ -68,9 +68,13 @@ INVALID_INPUT = f'This type of input was too strange, try something better or ty
DOWNLOADING_ERROR = '❌ An error occurred while downloading'
EXTRACTING_ERROR = '❌ An error ocurred while searching for the songs'
BAD_COMMAND_TITLE = 'Misuse of command'
BAD_COMMAND = f'❌ Bad usage of this command, type {BOT_PREFIX}help "command" to understand the command better'
COLOURS = {
'red': 0xDC143C,
'green': 0x58D68D,
'green': 0x1F8B4C,
'grey': 0x708090,
'blue': 0x3498DB
'blue': 0x206694,
'black': 0x23272A
}

View File

@ -9,8 +9,10 @@ HELP_CLEAR_LONG = 'Clear the songs queue and songs history. \n\nArguments: None.
HELP_STOP = 'Stop the song player.'
HELP_STOP_LONG = 'Stop the song player, clear queue and history and remove Vulkan from voice channel.\n\nArguments: None.'
HELP_LOOP = 'Control the loop of songs.'
HELP_LOOP_LONG = 'Controll the loop of songs.\n\n Require: A song being played.\nArguments:\nOne - Start looping the current song. \
\nAll - Start looping all songs in queue.\nOff - Disable loop.'
HELP_LOOP_LONG = """Control the loop of songs.\n\n Require: A song being played.\nArguments:
One - Start looping the current song.
All - Start looping all songs in queue.
Off - Disable loop."""
HELP_NP = 'Show the info of the current song.'
HELP_NP_LONG = 'Show the information of the song being played.\n\nRequire: A song being played.\nArguments: None.'
HELP_QUEUE = f'Show the first {MAX_PRELOAD_SONGS} songs in queue.'

View File

@ -1,6 +1,6 @@
import discord
from discord import Client
from discord.ext.commands.errors import CommandNotFound, MissingRequiredArgument
from discord.ext.commands.errors import CommandNotFound, MissingRequiredArgument, CommandInvokeError
from discord.ext import commands
from config import config
from config import help
@ -32,7 +32,7 @@ class Control(commands.Cog):
embed = discord.Embed(
title=config.ERROR_TITLE,
description=config.ERROR_MISSING_ARGUMENTS,
colour=config.COLOURS['red']
colour=config.COLOURS['black']
)
await ctx.send(embed=embed)
@ -40,9 +40,17 @@ class Control(commands.Cog):
embed = discord.Embed(
title=config.ERROR_TITLE,
description=config.COMMAND_NOT_FOUND,
colour=config.COLOURS['red']
colour=config.COLOURS['black']
)
await ctx.send(embed=embed)
elif isinstance(error, CommandInvokeError):
embed = discord.Embed(
title=config.BAD_COMMAND_TITLE,
description=config.BAD_COMMAND,
colour=config.COLOURS['black']
)
await ctx.send(embed=embed)
else:
print(error)
embed = discord.Embed(
@ -93,7 +101,7 @@ class Control(commands.Cog):
help_help += f'**{command}** - {command.help}\n'
helptxt = f'\n{help_music}\n{help_help}\n{help_random}'
helptxt += f'\n\nType {config.BOT_PREFIX}help "command" for more information about the command chosen'
embedhelp = discord.Embed(
title=f'**Available Commands of {self.__bot.user.name}**',
description=helptxt,

View File

@ -271,7 +271,7 @@ class Player(commands.Cog):
elif args == 'off':
description = self.__playlist.loop_off()
else:
description = help.HELP_LONG_LOOP
raise commands.CommandInvokeError('Invalid Arguments in Command')
return description