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