From a4a85e929fd1c02ae861fd3c69b260e88514c1d0 Mon Sep 17 00:00:00 2001 From: Admin Date: Fri, 24 Apr 2020 17:55:48 +0200 Subject: [PATCH] contrepeterie --- kabot/kabot/kabot.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/kabot/kabot/kabot.py b/kabot/kabot/kabot.py index 924b188..0c69633 100644 --- a/kabot/kabot/kabot.py +++ b/kabot/kabot/kabot.py @@ -160,11 +160,10 @@ class Mybot(commands.Cog): await ctx.channel.send("#" + str(issue['id']) + ": " + issue['title'] + '\n' + issue['web_url']) elif args[0] == 'add': title = ' '.join(args[1:]) - author = title + ' - By ' + ctx.message.author.name projects = gl.projects.list() for project in projects: if "Kabot" == project.name: - issue = project.issues.create({'title': author}) + issue = project.issues.create({'title': title}) await ctx.channel.send(issue.web_url) else: await ctx.channel.send('unknown command') @@ -197,6 +196,19 @@ class Mybot(commands.Cog): except: response = "Unknow error, try: !kaamelott [livre] [character]" await ctx.send(response) + + @commands.command(help="optionnal args : ") + async def contrepeterie(self, ctx, *args): + response = None + path = '/home/mika/kabot/kabot/kabot/ressources/contrepeteries.txt' + lines = open(path).read().splitlines() + myline =random.choice(lines) + + try: + response = "%s" % (myline) + except: + response = "Unknow error, try: !contrepeterie [mot clef]" + await ctx.send(response) @commands.command(help="Je menotte une cornemuse et je fume Eddy Malou") async def kamoulox(self, ctx):