correction commande commit

This commit is contained in:
BFlow 2020-08-27 18:34:19 +02:00
parent 0903b7a1c7
commit 36b1445994

View file

@ -73,13 +73,15 @@ class Mybot(commands.Cog):
self.sounds = []
@commands.command(help='list des commits')
async def commits(self, ctx):
async def commits(self, ctx, number = 5):
number = int(number)
gl = gitlab.Gitlab('https://git.0w.tf/', private_token='VHLsCQTcjF3oxujqFRYz')
gl.auth()
projects = gl.projects.list(search='Kabot')[0]
commits = projects.commits.list()[-5:]
commits = projects.commits.list()[-number:]
for commit in commits:
await ctx.channel.send(commit['title'] + ": " + commit['author_name'] + ": " '\n' + commit['web_url'])
detail = commit.attributes
await ctx.channel.send(detail['title'] + ": " + detail['author_name'] + ": " '\n' + detail['web_url'])
@commands.command()
async def disconnect(self, ctx):