correction commande commit
This commit is contained in:
parent
0903b7a1c7
commit
36b1445994
1 changed files with 5 additions and 3 deletions
|
@ -73,13 +73,15 @@ class Mybot(commands.Cog):
|
||||||
self.sounds = []
|
self.sounds = []
|
||||||
|
|
||||||
@commands.command(help='list des commits')
|
@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 = gitlab.Gitlab('https://git.0w.tf/', private_token='VHLsCQTcjF3oxujqFRYz')
|
||||||
gl.auth()
|
gl.auth()
|
||||||
projects = gl.projects.list(search='Kabot')[0]
|
projects = gl.projects.list(search='Kabot')[0]
|
||||||
commits = projects.commits.list()[-5:]
|
commits = projects.commits.list()[-number:]
|
||||||
for commit in commits:
|
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()
|
@commands.command()
|
||||||
async def disconnect(self, ctx):
|
async def disconnect(self, ctx):
|
||||||
|
|
Loading…
Reference in a new issue