diff options
author | aninternettroll <lucafulger@gmail.com> | 2021-05-24 16:53:39 +0000 |
---|---|---|
committer | aninternettroll <lucafulger@gmail.com> | 2021-05-24 16:53:39 +0000 |
commit | 80bef8c06e1debf01881c83c97ffe1105e880360 (patch) | |
tree | 5af97c9bf68c01e7185f579c652533fc33875d59 /cogs/src.py | |
parent | a39e7deaa681e6c35dadf60876f6ca2a6979f12c (diff) | |
download | steve-bot-80bef8c06e1debf01881c83c97ffe1105e880360.tar steve-bot-80bef8c06e1debf01881c83c97ffe1105e880360.tar.gz steve-bot-80bef8c06e1debf01881c83c97ffe1105e880360.tar.bz2 steve-bot-80bef8c06e1debf01881c83c97ffe1105e880360.tar.lz steve-bot-80bef8c06e1debf01881c83c97ffe1105e880360.tar.xz steve-bot-80bef8c06e1debf01881c83c97ffe1105e880360.tar.zst steve-bot-80bef8c06e1debf01881c83c97ffe1105e880360.zip |
Remove conflicting command
Diffstat (limited to '')
-rwxr-xr-x | cogs/src.py | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/cogs/src.py b/cogs/src.py index e9cc88b..07a0c39 100755 --- a/cogs/src.py +++ b/cogs/src.py @@ -383,46 +383,6 @@ async def verifiedCount(self, ctx, modName): await ctx.send(f"{modName} has verified {len(hold)} runs") - -async def queueLength(self, ctx, game): - head = {"Accept": "application/json", "User-Agent": "mcbeDiscordBot/1.0"} - async with self.bot.session.get( - f"https://www.speedrun.com/api/v1/games/{game}", headers=head - ) as r: - if r.status != 200: - await ctx.send(f"Could not find game {game}") - return - try: - r_json = await r.json() - gameID = r_json["data"]["id"] - gameName = r_json["data"]["names"]["international"] - except: - await ctx.send("Something went wrong") - return - - hold = [] - async with self.bot.session.get( - f"https://www.speedrun.com/api/v1/runs?game={gameID}&status=new&max=200", - headers=head, - ) as temp: - while True: - if temp.status != 200: - await ctx.send("Something went wrong") - return - temp_json = await temp.json() - hold.extend(temp_json["data"]) - if "pagination" not in temp_json or temp_json["pagination"]["size"] < 200: - break - temp = await self.bot.session.get( - {item["rel"]: item["uri"] for item in temp_json["pagination"]["links"]}[ - "next" - ], - headers=head, - ) - - await ctx.send(f"The queue for {gameName} has {len(hold)} runs") - - class Src(commands.Cog): def __init__(self, bot): self.bot = bot @@ -500,14 +460,6 @@ class Src(commands.Cog): return await verifiedCount(self, ctx, modName) - @commands.command() - async def queue(self, ctx, game=None): - async with ctx.typing(): - if game is None: - await ctx.send("Please supply a game to get the queue length of") - return - await queueLength(self, ctx, game) - @tasks.loop(minutes=10.0) async def checker(self): data = json.loads(Path("./api_keys.json").read_text()) |