This commit is contained in:
BFlow 2020-08-27 17:43:57 +02:00
parent bec13c53b5
commit cabbc221d1

View file

@ -73,19 +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, *args): async def commits(self, ctx):
if args:
args = list(args)
gl = gitlab.Gitlab('https://git.0w.tf/', private_token='VHLsCQTcjF3oxujqFRYz') gl = gitlab.Gitlab('https://git.0w.tf/', private_token='VHLsCQTcjF3oxujqFRYz')
gl.auth() gl.auth()
if args[0] == 'list':
projects = gl.projects.list(search='Kabot')[0] projects = gl.projects.list(search='Kabot')[0]
commits = projects.commits.list()[-5:] commits = projects.commits.list()[-5:]
for commit in commits: for commit in commits:
await ctx.channel.send(commit.comment) await ctx.channel.send(commit.comment)
await ctx.channel.send(commit.str) await ctx.channel.send(commit.str)
else: await ctx.channel.send(dir(commit))
await ctx.channel.send('unknown command')
@commands.command() @commands.command()
async def disconnect(self, ctx): async def disconnect(self, ctx):