correction command issue

This commit is contained in:
BFlow 2020-03-25 18:22:03 +01:00
parent 679515ca84
commit f0985e4752

View file

@ -140,16 +140,16 @@ class Mybot(commands.Cog):
gl.auth() gl.auth()
if args[0] == 'list': if args[0] == 'list':
projects = gl.projects.list(search='Kabot')[0] projects = gl.projects.list(search='Kabot')[0]
await ctx.channel.send(projects.name)
issues = projects.issues.list() issues = projects.issues.list()
for issue in issues: for issue in issues:
if "closed" == issue.state: if "closed" == issue.state:
pass pass
else: else:
await ctx.channel.send('Issue: %s' % issue.title) await ctx.channel.send('#' + str(issue.id) + ": " + issue.title + '\n' + issue.web_url)
elif args[0] == 'search': elif args[0] == 'search':
query = ''.join(args[1:]) query = ''.join(args[1:])
find_issues = gl.search("issues", query) project = gl.projects.get('Kabot')
find_issues = project.search("issues", query)
for issue in find_issues: for issue in find_issues:
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':