Fixing some errors

This commit is contained in:
Rafael Vargas 2022-03-26 21:40:04 -04:00
parent b4159c7e86
commit caaa48ba05
5 changed files with 9 additions and 7 deletions

View File

@ -102,6 +102,7 @@ class Control(commands.Cog):
@commands.command(name='invite', help=helper.HELP_INVITE, description=helper.HELP_INVITE_LONG)
async def invite_bot(self, ctx):
invite_url = self.__config.INVITE_URL.format(self.__bot.user.id)
print(invite_url)
txt = self.__config.INVITE_MESSAGE.format(invite_url, invite_url)
embed = Embed(

View File

@ -1,3 +1,4 @@
import asyncio
from discord.ext.commands import Context
from discord import Client
from Controllers.AbstractController import AbstractController
@ -22,7 +23,7 @@ class QueueController(AbstractController):
embed = self.embeds.EMPTY_QUEUE()
return ControllerResponse(self.ctx, embed)
await self.__down.preload(songs_preload)
asyncio.create_task(self.__down.preload(songs_preload))
if self.player.playlist.looping_all:
title = self.messages.ALL_SONGS_LOOPING

View File

@ -1,4 +1,5 @@
from Config.Config import Configs
from Config.Messages import Messages
class Error(Exception):
@ -18,9 +19,9 @@ class Error(Exception):
class ImpossibleMove(Error):
def __init__(self, message='', title='', *args: object) -> None:
config = Configs()
message = Messages()
if title == '':
title = config.IMPOSSIBLE_MOVE
title = message.IMPOSSIBLE_MOVE
super().__init__(message, title, *args)

View File

@ -66,7 +66,7 @@ class Messages(Singleton):
self.BAD_COMMAND_TITLE = 'Misuse of command'
self.BAD_COMMAND = f'❌ Bad usage of this command, type {configs.BOT_PREFIX}help "command" to understand the command better'
self.VIDEO_UNAVAILABLE = '❌ Sorry. This video is unavailable for download.'
self.ERROR_DUE_LOOP_ONE_ON = f'❌ This command cannot be executed with loop one activated. Use {self.BOT_PREFIX}loop off to disable loop.'
self.ERROR_DUE_LOOP_ONE_ON = f'❌ This command cannot be executed with loop one activated. Use {configs.BOT_PREFIX}loop off to disable loop.'
class SearchMessages(Singleton):

View File

@ -20,8 +20,7 @@ class Configs(Singleton):
self.MAX_SONGS_HISTORY = 15
self.INVITE_MESSAGE = """To invite Vulkan to your own server, click [here]({}).
Or use this direct URL: ({})"""
Or use this direct URL: {}"""
self.MY_ERROR_BAD_COMMAND = 'This string serves to verify if some error was raised by myself on purpose'
self.INVITE_URL = 'https://discordapp.com/oauth2/authorize?client_id={}&scope=bot>'
self.INVITE_URL = 'https://discordapp.com/oauth2/authorize?client_id={}&scope=bot'