From 06a00e227dfa0c165555b3a2f68805392864b539 Mon Sep 17 00:00:00 2001 From: Rafael Vargas Date: Thu, 6 Jan 2022 13:21:18 -0400 Subject: [PATCH] Adding reset command, some variable to config --- config/config.py | 6 ++++++ vulkanbot/general/Control.py | 2 +- vulkanbot/music/utils.py | 8 ++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/config/config.py b/config/config.py index b4bbe79..f4e1f9a 100644 --- a/config/config.py +++ b/config/config.py @@ -45,6 +45,7 @@ HELP_SHUFFLE = 'Shuffle the songs playing' HELP_PLAY = '(title/youtube/spotify) - Plays a song' HELP_MOVE = '(x, y) - Moves a song from position x to y in queue' HELP_REMOVE = '(x, -1) - Remove a song in the position x or -1 for the last song' +HELP_RESET = 'Reset the Player of a guild' HELP_WARFRAME = f'({BOT_PREFIX}warframe help for more)' HELP_RANDOM = '(x) - Return a random number between 1 and x' HELP_ESCOLHA = '(x, y, z...) - Choose randomly one item passed' @@ -53,6 +54,11 @@ HELP_DROP = '(user_name) - Try to remove the user from the current voice channel HELP_FRASE = "Send a randomly phrase, perhaps you get the braba" HELP_HELP = 'This command :)' +NO_CHANNEL = 'To play some music, connect to any voice channel first.' +INVALID_INPUT = 'This type of input was too strange, try something better' +DOWNLOADING_ERROR = 'An error occurred while downloading' +SONG_ADDED = 'Song added to the Queue' + ABSOLUTE_PATH = '' COOKIE_PATH = '/config/cookies/cookies.txt' diff --git a/vulkanbot/general/Control.py b/vulkanbot/general/Control.py index f3fd04d..5b1edc4 100644 --- a/vulkanbot/general/Control.py +++ b/vulkanbot/general/Control.py @@ -11,7 +11,7 @@ class Control(commands.Cog): def __init__(self, bot: Client): self.__bot = bot self.__comandos = { - 'MUSIC': ['resume', 'pause', 'loop', 'stop', 'skip', 'play', 'queue', 'clear', 'np', 'shuffle', 'move', 'remove'], + 'MUSIC': ['resume', 'pause', 'loop', 'stop', 'skip', 'play', 'queue', 'clear', 'np', 'shuffle', 'move', 'remove', 'reset'], 'WARFRAME': ['warframe'], 'RANDOM': ['escolha', 'cara', 'random'], 'HELP': ['help'], diff --git a/vulkanbot/music/utils.py b/vulkanbot/music/utils.py index 8b1a0ff..a57efe4 100644 --- a/vulkanbot/music/utils.py +++ b/vulkanbot/music/utils.py @@ -1,6 +1,14 @@ import re +def is_connected(ctx): + try: + voice_channel = ctx.guild.voice_client.channel + return voice_channel + except: + return None + + def format_time(duration): if not duration: return "00:00"