From 713c694d0346efe820501aec29e217758a7617a7 Mon Sep 17 00:00:00 2001 From: BFlow Date: Sun, 17 Nov 2019 18:18:12 +0100 Subject: [PATCH] ajout commande slap et clean code --- kabot/kabot/kabot.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/kabot/kabot/kabot.py b/kabot/kabot/kabot.py index 6b985e3..01fbf60 100644 --- a/kabot/kabot/kabot.py +++ b/kabot/kabot/kabot.py @@ -76,12 +76,16 @@ class Mybot(commands.Cog): await message.channel.send('pong') @commands.command(help='count lines numbers in quote file') - async def lines(self, message): - path = '/home/mika/.kabot/%s.log' % message.channel + async def lines(self, ctx): + path = '/home/mika/.kabot/%s.log' % ctx.channel with open(path, 'r') as f: lines = f.read().splitlines() nb_lines = len(lines) - await message.channel.send("j'ai %s lignes dans mon stock" % nb_lines) + await ctx.channel.send("j'ai %s lignes dans mon stock" % nb_lines) + + @commands.command(help='slap this ass') + async def slap(self, ctx, user): + await ctx.channel.send("j'attrape %s est lui met une tarte!" % user) @commands.command(help="optionnal args : [livre] [character]") async def kaamelott(self, ctx, *args):