ajout de la commande lines

This commit is contained in:
BFlow 2019-11-16 18:37:10 +01:00
parent 770792a5bd
commit 5eed8bab06

View file

@ -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