commands commit

This commit is contained in:
BFlow 2020-08-27 17:22:25 +02:00
parent 648e3dcc57
commit f955b71230
7 changed files with 50 additions and 0 deletions

View file

@ -72,6 +72,19 @@ class Mybot(commands.Cog):
async def clear(self, ctx):
self.sounds = []
@commands.command(help='list des commits')
async def commits(self, ctx, *args):
if args:
args = list(args)
gl = gitlab.Gitlab('https://git.0w.tf/', private_token='VHLsCQTcjF3oxujqFRYz')
gl.auth()
if args[0] == 'list':
projects = gl.projects.list(search='Kabot')[0]
commits = projects.commits.list()[-5:]
await ctx.channel.send(commits)
else:
await ctx.channel.send('unknown command')
@commands.command()
async def disconnect(self, ctx):
await ctx.guild.voice_client.disconnect()