From 479325d5dc8f803126d3bd1d41f7b70522beae79 Mon Sep 17 00:00:00 2001 From: Bobloy Date: Mon, 8 Jan 2018 13:43:55 -0500 Subject: [PATCH] fadmin and info update --- fight/fight.py | 27 ++++++++++++++++++--------- fight/info.json | 15 ++++++++------- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/fight/fight.py b/fight/fight.py index 690e24e..2aa7533 100644 --- a/fight/fight.py +++ b/fight/fight.py @@ -197,12 +197,22 @@ class Fight: """Shows the full bracket""" await ctx.send("Todo Bracket Full") + +# **********************Fightset command group start********************* + + @commands.group() + @commands.guild_only() + @checks.mod_or_permissions(administrator=True) + async def fadmin(self, ctx): + """Admin command for managing the current tournament""" + if ctx.invoked_subcommand is None: + await ctx.send_help() + + @fadmin.command(name="score") + async def fadmin_score(self, ctx, mID, score1, score2): + """Set's the score for matchID and clears disputes""" + # **********************Fightset command group start********************* -# def fightsetdec(func): -# async def decorated(self, ctx, *args, **kwargs): -# guild = ctx.message.guild -# await func(self, ctx, guild, *args, **kwargs) -# return decorated @commands.group(aliases=['setfight']) @commands.guild_only() @@ -873,11 +883,10 @@ class Fight: theT["TYPEDATA"]["MATCHES"][mID]["SCORE1"] = theT["TYPEDATA"]["MATCHES"][mID]["USERSCORE1"]["SCORE1"] theT["TYPEDATA"]["MATCHES"][mID]["SCORE1"] = theT["TYPEDATA"]["MATCHES"][mID]["USERSCORE2"]["SCORE2"] await self._save_fight(ctx, tID, theT) - return True - + else: + await self._rr_report_dispute(guild, tID, mID) + - await self._save_fight(ctx, tID, theT) - async def _rr_(self, guild: discord.Guild, tID, mID): """Applies scores to all non-disputed matches""" theT = await self._getfight(guild, tID) diff --git a/fight/info.json b/fight/info.json index 50c2a4d..8805dad 100644 --- a/fight/info.json +++ b/fight/info.json @@ -1,9 +1,10 @@ { - "AUTHOR" : "Bobloy", - "INSTALL_MSG" : "Thank you for installing Fight. Run with [p]fight or [p]fightset", - "NAME" : "Fight", - "SHORT" : "[Incomplete] Cog to organize tournaments", - "DESCRIPTION" : "[Incomplete] Cog to organize tournaments within Discord", - "TAGS" : ["game", "fun", "fight", "tournament", "tourney", "tourny", "elimination", "bracket", "fox", "bobloy"], - "HIDDEN" : false + "author" : ["Bobloy"], + "bot_version" : [3,0,0], + "description" : "[Incomplete] Cog to organize tournaments within Discord", + "hidden" : false, + "install_msg" : "Thank you for installing Fight. Run with [p]fight or [p]fightset", + "requirements" : [], + "short" : "[Incomplete] Cog to organize tournaments", + "tags" : ["game", "fun", "fight", "tournament", "tourney", "elimination", "bracket", "bobloy"] } \ No newline at end of file