diff --git a/config/config.py b/config/config.py index 1b39e20..3803045 100644 --- a/config/config.py +++ b/config/config.py @@ -24,6 +24,7 @@ MAX_PRELOAD_SONGS = 10 SONGINFO_UPLOADER = "Uploader: " SONGINFO_DURATION = "Duration: " +SONGINFO_REQUESTER = 'Requester: ' HELP_SKIP = 'Skip the current playing song' HELP_RESUME = 'Resumes the song player' diff --git a/vulkan/commands/Music.py b/vulkan/commands/Music.py index 84c379a..79c4c7f 100644 --- a/vulkan/commands/Music.py +++ b/vulkan/commands/Music.py @@ -19,6 +19,7 @@ class Music(commands.Cog): @commands.command(name="play", help=config.HELP_PLAY, aliases=['p', 'tocar']) async def play(self, ctx, *args): user_input = " ".join(args) + requester = ctx.author.name player = self.__get_player(ctx) if player == None: @@ -31,7 +32,7 @@ class Music(commands.Cog): await self.__send_embed(ctx, description=result['reason'], colour_name='red') return - await player.play(ctx, user_input) + await player.play(ctx, user_input, requester) @commands.command(name="queue", help=config.HELP_QUEUE, aliases=['q', 'fila']) async def queue(self, ctx): diff --git a/vulkan/music/Player.py b/vulkan/music/Player.py index 18682a5..7eea3c3 100644 --- a/vulkan/music/Player.py +++ b/vulkan/music/Player.py @@ -280,7 +280,11 @@ class Player(commands.Cog): embedvc.add_field(name=config.SONGINFO_UPLOADER, value=info['uploader'], - inline=False) + inline=True) + + embedvc.add_field(name=config.SONGINFO_REQUESTER, + value=info['requester'], + inline=True) if 'thumbnail' in info.keys(): embedvc.set_thumbnail(url=info['thumbnail']) diff --git a/vulkan/music/Playlist.py b/vulkan/music/Playlist.py index 66684e3..f2c34d5 100644 --- a/vulkan/music/Playlist.py +++ b/vulkan/music/Playlist.py @@ -77,9 +77,9 @@ class Playlist(IPlaylist): else: return self.__songs_history[0].source - def add_song(self, identifier: str) -> Song: + def add_song(self, identifier: str, requester: str) -> Song: """Create a song object, add to queue and return it""" - song = Song(identifier, self) # Cria a musica com o identificador + song = Song(identifier=identifier, playlist=self, requester=requester) self.__queue.append(song) return song diff --git a/vulkan/music/Song.py b/vulkan/music/Song.py index 3c9a8cb..9161742 100644 --- a/vulkan/music/Song.py +++ b/vulkan/music/Song.py @@ -4,10 +4,10 @@ from vulkan.music.Interfaces import ISong, IPlaylist class Song(ISong): """Store the usefull information about a Song""" - def __init__(self, identifier: str, playlist: IPlaylist) -> None: + def __init__(self, identifier: str, playlist: IPlaylist, requester: str) -> None: """Create a song with only the URL to the youtube song""" self.__identifier = identifier - self.__info = {} + self.__info = {'requester': requester} self.__problematic = False self.__playlist: IPlaylist = playlist