ajout commande slap et clean code

This commit is contained in:
BFlow 2019-11-17 18:18:12 +01:00
parent 5eed8bab06
commit 713c694d03

View file

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