|
|
|
@ -1,7 +1,7 @@
|
|
|
|
import discord
|
|
|
|
import discord
|
|
|
|
from discord.ext import commands
|
|
|
|
from discord.ext import commands
|
|
|
|
import logging
|
|
|
|
import logging
|
|
|
|
from src.imports.utils import Paginator, run_command
|
|
|
|
from src.imports.utils import Paginator, run_command, Book
|
|
|
|
import asyncio
|
|
|
|
import asyncio
|
|
|
|
|
|
|
|
|
|
|
|
owner_id = 351794468870946827
|
|
|
|
owner_id = 351794468870946827
|
|
|
|
@ -29,22 +29,21 @@ class Git:
|
|
|
|
@git.command()
|
|
|
|
@git.command()
|
|
|
|
@commands.is_owner()
|
|
|
|
@commands.is_owner()
|
|
|
|
async def pull(self, ctx):
|
|
|
|
async def pull(self, ctx):
|
|
|
|
pag = Paginator(max_line_length=60, max_lines=30, max_chars=1014)
|
|
|
|
pag = Paginator(self.bot, max_line_length=60, embed=True)
|
|
|
|
em = discord.Embed(style='rich',
|
|
|
|
pag.set_embed_meta(title='Git Pull',
|
|
|
|
title=f'Git Pull',
|
|
|
|
color=self.bot.embed_color,
|
|
|
|
color=embed_color)
|
|
|
|
thumbnail=f'{ctx.guild.me.avatar_url}')
|
|
|
|
em.set_thumbnail(url=f'{ctx.guild.me.avatar_url}')
|
|
|
|
pag.add('\uFFF6' + await asyncio.wait_for(self.bot.loop.create_task(run_command('git fetch --all')), 120))
|
|
|
|
result = await asyncio.wait_for(self.bot.loop.create_task(run_command('git fetch --all')), 120) + '\n'
|
|
|
|
pag.add(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 reset --hard '
|
|
|
|
'origin/$(git '
|
|
|
|
'origin/$(git '
|
|
|
|
'rev-parse --symbolic-full-name'
|
|
|
|
'rev-parse --symbolic-full-name'
|
|
|
|
' --abbrev-ref HEAD)')), 120))
|
|
|
|
' --abbrev-ref HEAD)')), 120) + '\n\n'
|
|
|
|
pag.add('\uFFF7\n\uFFF8')
|
|
|
|
result += await asyncio.wait_for(self.bot.loop.create_task(run_command('git show --stat | '
|
|
|
|
pag.add(await asyncio.wait_for(self.bot.loop.create_task(run_command('git show --stat | '
|
|
|
|
'sed "s/.*@.*[.].*/ /g"')), 10)
|
|
|
|
'sed "s/.*@.*[.].*/ /g"')), 10))
|
|
|
|
pag.add(result)
|
|
|
|
msg = await ctx.send('Starting Book')
|
|
|
|
for page in pag.pages():
|
|
|
|
book = Book(pag, (msg, ctx.channel, self.bot, ctx.message))
|
|
|
|
em.add_field(name='', value=f'{page}')
|
|
|
|
await book.create_book()
|
|
|
|
await ctx.send(embed=em)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@git.command()
|
|
|
|
@git.command()
|
|
|
|
@commands.is_owner()
|
|
|
|
@commands.is_owner()
|
|
|
|
|