ajout commande slap et clean code
This commit is contained in:
parent
5eed8bab06
commit
713c694d03
1 changed files with 7 additions and 3 deletions
|
@ -76,12 +76,16 @@ class Mybot(commands.Cog):
|
||||||
await message.channel.send('pong')
|
await message.channel.send('pong')
|
||||||
|
|
||||||
@commands.command(help='count lines numbers in quote file')
|
@commands.command(help='count lines numbers in quote file')
|
||||||
async def lines(self, message):
|
async def lines(self, ctx):
|
||||||
path = '/home/mika/.kabot/%s.log' % message.channel
|
path = '/home/mika/.kabot/%s.log' % ctx.channel
|
||||||
with open(path, 'r') as f:
|
with open(path, 'r') as f:
|
||||||
lines = f.read().splitlines()
|
lines = f.read().splitlines()
|
||||||
nb_lines = len(lines)
|
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]")
|
@commands.command(help="optionnal args : [livre] [character]")
|
||||||
async def kaamelott(self, ctx, *args):
|
async def kaamelott(self, ctx, *args):
|
||||||
|
|
Loading…
Reference in a new issue