Make fight importable

pull/9/head
Bobloy 7 years ago
parent 362474e24f
commit 47d6392d0d

@ -1,10 +1,11 @@
import asyncio
import os import os
import math import math
# from typing import Union # from typing import Union
import discord import discord
from redbot.core.commands import commands from redbot.core import commands
from redbot.core.utils.chat_formatting import pagify from redbot.core.utils.chat_formatting import pagify
from redbot.core.utils.chat_formatting import box from redbot.core.utils.chat_formatting import box
@ -201,7 +202,7 @@ class Fight:
await ctx.send_help() await ctx.send_help()
@fadmin.command(name="score") @fadmin.command(name="score")
async def fadmin_score(self, ctx, mID, score1, score2): async def fadmin_score(self, ctx: commands.Context, mID, score1, score2):
"""Set's the score for matchID and clears disputes""" """Set's the score for matchID and clears disputes"""
currFight = await self._getcurrentfight(ctx) currFight = await self._getcurrentfight(ctx)
tID = await self._activefight(ctx) tID = await self._activefight(ctx)
@ -213,11 +214,11 @@ class Fight:
await ctx.send("Tournament currently not accepting new players") await ctx.send("Tournament currently not accepting new players")
return return
if await self._infight(ctx, tID, user.id): if await self._infight(ctx, tID, ctx.user.id):
await ctx.send("You are already in this tournament!") await ctx.send("You are already in this tournament!")
return return
currFight["PLAYERS"].append(user.id) currFight["PLAYERS"].append(ctx.user.id)
await self._save_fight(ctx, tID, currFight) await self._save_fight(ctx, tID, currFight)
@ -711,11 +712,13 @@ class Fight:
async def _embed_tourney(self, ctx, tID): async def _embed_tourney(self, ctx, tID):
"""Prints a pretty embed of the tournament""" """Prints a pretty embed of the tournament"""
await ctx.send("_placeholder Todo") #_placeholder Todo
pass
async def _comparescores(self): async def _comparescores(self):
"""Checks user submitted scores for inconsistancies""" """Checks user submitted scores for inconsistancies"""
await ctx.send("_comparescores Todo") # _comparescores Todo
pass
async def _parseuser(self, guild: discord.Guild, tID, userid): async def _parseuser(self, guild: discord.Guild, tID, userid):
"""Finds user in the tournament""" """Finds user in the tournament"""
@ -821,8 +824,8 @@ class Fight:
"""Reports a win for member in match""" """Reports a win for member in match"""
theT = await self._getfight(guild, tID) theT = await self._getfight(guild, tID)
if member.id not in theT["PLAYERS"]: # Shouldn't happen # if member.id not in theT["PLAYERS"]: # Shouldn't happen
return False # return False
if theT["RULES"]["TYPE"] == 0: if theT["RULES"]["TYPE"] == 0:
return await self._rr_report_dispute(guild, tID, mID) return await self._rr_report_dispute(guild, tID, mID)
@ -833,13 +836,16 @@ class Fight:
# **********************Single Elimination*************************** # **********************Single Elimination***************************
async def _elim_setup(self, tID): async def _elim_setup(self, tID):
await ctx.send("Elim setup todo") # ToDo Elim setup
pass
async def _elim_start(self, tID): async def _elim_start(self, tID):
await ctx.send("Elim start todo") # ToDo Elim start
pass
async def _elim_update(self, matchID): async def _elim_update(self, matchID):
await ctx.send("Elim update todo") # ToDo Elim update
pass
# **********************Round-Robin********************************** # **********************Round-Robin**********************************

Loading…
Cancel
Save