Added typing to git command
This commit is contained in:
parent
8a1d5e9fca
commit
e791887485
29
exts/git.py
29
exts/git.py
@ -48,20 +48,21 @@ class Git:
|
|||||||
@git.command()
|
@git.command()
|
||||||
@commands.is_owner()
|
@commands.is_owner()
|
||||||
async def pull(self, ctx):
|
async def pull(self, ctx):
|
||||||
em = discord.Embed(style='rich',
|
async with ctx.typing():
|
||||||
title=f'Git Pull',
|
em = discord.Embed(style='rich',
|
||||||
color=self.bot.embed_color)
|
title=f'Git Pull',
|
||||||
em.set_thumbnail(url=f'{ctx.guild.me.avatar_url}')
|
color=self.bot.embed_color)
|
||||||
result = await asyncio.wait_for(self.bot.loop.create_task(run_command('git fetch --all')), 120) + '\n'
|
em.set_thumbnail(url=f'{ctx.guild.me.avatar_url}')
|
||||||
result += await asyncio.wait_for(self.bot.loop.create_task(run_command('git reset --hard '
|
result = await asyncio.wait_for(self.bot.loop.create_task(run_command('git fetch --all')), 120) + '\n'
|
||||||
'origin/$(git '
|
result += await asyncio.wait_for(self.bot.loop.create_task(run_command('git reset --hard '
|
||||||
'rev-parse --symbolic-full-name'
|
'origin/$(git '
|
||||||
' --abbrev-ref HEAD)')), 120) + '\n\n'
|
'rev-parse --symbolic-full-name '
|
||||||
result += await asyncio.wait_for(self.bot.loop.create_task(run_command('git show --stat | '
|
'--abbrev-ref HEAD)')), 120) + '\n\n'
|
||||||
'sed "s/.*@.*[.].*/ /g"')), 10)
|
result += await asyncio.wait_for(self.bot.loop.create_task(run_command('git show --stat | '
|
||||||
results = paginate(result, maxlen=1014)
|
'sed "s/.*@.*[.].*/ /g"')), 10)
|
||||||
for page in results[:5]:
|
results = paginate(result, maxlen=1014)
|
||||||
em.add_field(name='', value=f'{page}')
|
for page in results[:5]:
|
||||||
|
em.add_field(name='', value=f'{page}')
|
||||||
await ctx.send(embed=em)
|
await ctx.send(embed=em)
|
||||||
|
|
||||||
@git.command()
|
@git.command()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user