From 64d3234cab4ce62bb245cd5513845be70f4ada97 Mon Sep 17 00:00:00 2001 From: BFlow Date: Tue, 28 Apr 2020 14:58:55 +0200 Subject: [PATCH] =?UTF-8?q?peaufinement=20n=C2=B02=20de=20la=20classificat?= =?UTF-8?q?ion=20par=20ordre=20alphabetique=20du=20bot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kabot/kabot/kabot.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/kabot/kabot/kabot.py b/kabot/kabot/kabot.py index 84df76e..3df5032 100644 --- a/kabot/kabot/kabot.py +++ b/kabot/kabot/kabot.py @@ -20,8 +20,8 @@ from bs4 import BeautifulSoup as bs here = os.path.dirname(os.path.abspath(__file__)) -#Fonction necesaire pour le bot. class Mybot(commands.Cog): + #Fonctions necesaires pour Kabot. def __init__(self, bot): self.bot = bot self.sounds = [] @@ -41,9 +41,9 @@ class Mybot(commands.Cog): self.sounds_history.reverse() if len(self.sounds_history) > 5: self.sounds_history = self.sounds_history[:5] - #Fin des fonction necesaire pour le bot. + #Fin des fonctions necesaire pour Kabot. - #Les commandes pour interagir avec le bot. + #Les commandes pour interagir avec Kabot. @commands.command() async def disconnect(self, ctx): await ctx.guild.voice_client.disconnect() @@ -99,14 +99,6 @@ class Mybot(commands.Cog): async def ping(self, message): await message.channel.send('pong') - @commands.command() - async def repeat(self, ctx): - # if ctx.message.author.name == self.bot.user.name: - # return - user = ctx.message.author.name - source = self.sounds_history[0] - self.sounds.append(source) - @commands.command(help='Restart Bot') async def restart(self, ctx): await self.bot.logout() @@ -119,9 +111,9 @@ class Mybot(commands.Cog): async def update(self, message): output = Popen('git pull'.split(), stdout=PIPE).communicate()[0] await message.channel.send(output.decode('utf-8')) - #Fin des commandes pour interagir avec le bot. + #Fin des commandes pour interagir avec Kabot. - #Les commandes pour faire mumuse avec le bot. + #Les commandes pour faire mumuse avec Kabot. @commands.command(help="randomsur l'avenir des gens.") async def avenir(self, ctx): @@ -256,6 +248,14 @@ class Mybot(commands.Cog): await asyncio.sleep(1) await ctx.channel.send("Tu peux reparler %s!" % member.mention) + @commands.command() + async def repeat(self, ctx): + # if ctx.message.author.name == self.bot.user.name: + # return + user = ctx.message.author.name + source = self.sounds_history[0] + self.sounds.append(source) + @commands.command(help="Appuie sur la detente PUSSY!") async def roulette(self, ctx): mute_time = 60 @@ -336,7 +336,7 @@ class Mybot(commands.Cog): except: audio_file = random.choice([f for f in Path(here + '/Audio/').glob('**/*.mp3')]) self.sounds.append((audio_file, ctx)) - #Fin des commandes pour faire mumuse avec le bot. + #Fin des commandes pour faire mumuse avec Kabot. def get_word(word_type): """Chercher les mots pour la fonction kamoulox dans le fichier xml""" @@ -401,7 +401,7 @@ def get_word(word_type): result = 'Nique bien ta mère!' return result -#Le do[main]e du bot. +#Le do[main]e de Kabot. def main(): token = "NjI3MTM3NDY1MDA5ODMxOTQ2.XY4Raw.pw8sAen3bNR5aYsoTChQOudM0L8" bot = commands.Bot(command_prefix='!')