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

2
.idea/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
# Default ignored files
/workspace.xml

View file

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

11
.idea/kabot.iml Normal file
View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TestRunnerService">
<option name="PROJECT_TEST_RUNNER" value="Unittests" />
</component>
</module>

4
.idea/misc.xml Normal file
View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (kabot)" project-jdk-type="Python SDK" />
</project>

8
.idea/modules.xml Normal file
View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/kabot.iml" filepath="$PROJECT_DIR$/.idea/kabot.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View file

@ -72,6 +72,19 @@ class Mybot(commands.Cog):
async def clear(self, ctx): async def clear(self, ctx):
self.sounds = [] 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() @commands.command()
async def disconnect(self, ctx): async def disconnect(self, ctx):
await ctx.guild.voice_client.disconnect() await ctx.guild.voice_client.disconnect()