contrepeterie
This commit is contained in:
parent
98b6f66a90
commit
a4a85e929f
1 changed files with 14 additions and 2 deletions
|
@ -160,11 +160,10 @@ class Mybot(commands.Cog):
|
||||||
await ctx.channel.send("#" + str(issue['id']) + ": " + issue['title'] + '\n' + issue['web_url'])
|
await ctx.channel.send("#" + str(issue['id']) + ": " + issue['title'] + '\n' + issue['web_url'])
|
||||||
elif args[0] == 'add':
|
elif args[0] == 'add':
|
||||||
title = ' '.join(args[1:])
|
title = ' '.join(args[1:])
|
||||||
author = title + ' - By ' + ctx.message.author.name
|
|
||||||
projects = gl.projects.list()
|
projects = gl.projects.list()
|
||||||
for project in projects:
|
for project in projects:
|
||||||
if "Kabot" == project.name:
|
if "Kabot" == project.name:
|
||||||
issue = project.issues.create({'title': author})
|
issue = project.issues.create({'title': title})
|
||||||
await ctx.channel.send(issue.web_url)
|
await ctx.channel.send(issue.web_url)
|
||||||
else:
|
else:
|
||||||
await ctx.channel.send('unknown command')
|
await ctx.channel.send('unknown command')
|
||||||
|
@ -197,6 +196,19 @@ class Mybot(commands.Cog):
|
||||||
except:
|
except:
|
||||||
response = "Unknow error, try: !kaamelott [livre] [character]"
|
response = "Unknow error, try: !kaamelott [livre] [character]"
|
||||||
await ctx.send(response)
|
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")
|
@commands.command(help="Je menotte une cornemuse et je fume Eddy Malou")
|
||||||
async def kamoulox(self, ctx):
|
async def kamoulox(self, ctx):
|
||||||
|
|
Loading…
Reference in a new issue