diff --git a/kabot/kabot/kabot.py b/kabot/kabot/kabot.py index fb44f8c..6b985e3 100644 --- a/kabot/kabot/kabot.py +++ b/kabot/kabot/kabot.py @@ -75,6 +75,14 @@ class Mybot(commands.Cog): async def ping(self, message): 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 + 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) + @commands.command(help="optionnal args : [livre] [character]") async def kaamelott(self, ctx, *args): response = None