From 012feae29c116ace2a60b0124fc8bdea394bc549 Mon Sep 17 00:00:00 2001 From: Milka64 Date: Thu, 28 Dec 2023 17:10:52 +0100 Subject: [PATCH] WIP #51 --- .gitlab-ci.yml | 2 +- kabot/kabot/utils/audio.py | 12 ++++++++++++ kabot/setup.py | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index db2e650..8d8ee73 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,7 @@ stages: variables: GL_TOKEN: $GL_TOKEN - VERSION: '0.2.3' + VERSION: '0.2.4' deploy: stage: deploy diff --git a/kabot/kabot/utils/audio.py b/kabot/kabot/utils/audio.py index 495fc45..1384a4d 100644 --- a/kabot/kabot/utils/audio.py +++ b/kabot/kabot/utils/audio.py @@ -199,6 +199,7 @@ class Audio(commands.Cog, name="Commandes Audio"): @commands.command() async def welcome(self, ctx, user=None): + """Joue le son d'accueil de l'utilisateur""" if not user: user = ctx.message.author.name try: @@ -268,6 +269,17 @@ class Audio(commands.Cog, name="Commandes Audio"): await ctx.voice_client.disconnect() + @commands.command() + async def find(self, ctx, query): + """Cherche un son dans la bibliothèque""" + if query: + query = query.lower() + audio_files = [f for f in Path(self.audio_path + '/').glob('**/*.mp3') if query in str(f).lower()] + if not audio_files: + await ctx.channel.send("%s not found" % query) + else: + await ctx.channel.send("\n".join(audio_files)) + @commands.command() async def joke(self, ctx, folder=None): """Joue un son (aléatoire par défaut)""" diff --git a/kabot/setup.py b/kabot/setup.py index 873ff53..243ee57 100644 --- a/kabot/setup.py +++ b/kabot/setup.py @@ -61,6 +61,6 @@ setup( test_suite='tests', tests_require=test_requirements, url='https://github.com/None/kabot', - version='0.2.3', + version='0.2.4', zip_safe=False, )