aboutsummaryrefslogtreecommitdiff
path: root/cogs/src.py
diff options
context:
space:
mode:
author0ceanlight <59946346+0ceanlight@users.noreply.github.com>2020-07-24 01:36:24 +0000
committerGitHub <noreply@github.com>2020-07-24 01:36:24 +0000
commit95a61e8d70eb8069d3c7adb2ecf7d59d252cef3e (patch)
treee6167e7c47e24f1b2f8b3346d2acdc20edef6126 /cogs/src.py
parentc8ed74e1b9ffc3070c76fe7f84350df390fc4a50 (diff)
parent41526349740b6ed8e4d5564ed67934016126d7be (diff)
downloadsteve-bot-95a61e8d70eb8069d3c7adb2ecf7d59d252cef3e.tar
steve-bot-95a61e8d70eb8069d3c7adb2ecf7d59d252cef3e.tar.gz
steve-bot-95a61e8d70eb8069d3c7adb2ecf7d59d252cef3e.tar.bz2
steve-bot-95a61e8d70eb8069d3c7adb2ecf7d59d252cef3e.tar.lz
steve-bot-95a61e8d70eb8069d3c7adb2ecf7d59d252cef3e.tar.xz
steve-bot-95a61e8d70eb8069d3c7adb2ecf7d59d252cef3e.tar.zst
steve-bot-95a61e8d70eb8069d3c7adb2ecf7d59d252cef3e.zip
Merge pull request #2 from AnInternetTroll/master
updating fork
Diffstat (limited to 'cogs/src.py')
-rwxr-xr-xcogs/src.py22
1 files changed, 10 insertions, 12 deletions
diff --git a/cogs/src.py b/cogs/src.py
index 96bf53c..bf776e7 100755
--- a/cogs/src.py
+++ b/cogs/src.py
@@ -63,11 +63,6 @@ async def deleteRun(self, apiKey, ctx, run):
await ctx.send("Something went wrong")
await ctx.message.author.send(f"```json\n{json.dumps(json.loads(r.text),indent=4)}```")
-async def clear(self):
- async for msg in self.bot.get_channel(699713639866957905).history():
- await msg.delete()
-
-
async def pendingRuns(self, ctx):
mcbe_runs = 0
mcbeil_runs = 0
@@ -124,11 +119,11 @@ async def pendingRuns(self, ctx):
mcbece_runs += 1
embed = discord.Embed(
title=leaderboard, url=link, description=f"{categoryName} in `{str(rta).replace('000','')}` by **{player}**", color=16711680+i*60, timestamp=timestamp)
- await self.bot.get_channel(699713639866957905).send(embed=embed)
+ await self.bot.get_channel(int(self.bot.config[str(ctx.message.guild.id)]["pending_channel"])).send(embed=embed)
runs = runs2
gameID = gameID2
embed_stats = discord.Embed(title='Pending Run Stats', description=f"Full Game Runs: {mcbe_runs}\nIndividual Level Runs: {mcbeil_runs}\nCategory Extension Runs: {mcbece_runs}", color=16711680 + i * 60)
- await self.bot.get_channel(699713639866957905).send(embed=embed_stats)
+ await self.bot.get_channel(int(self.bot.config[str(ctx.message.guild.id)]["pending_channel"])).send(embed=embed_stats)
async def verifyNew(self, apiKey=None, userID=None):
@@ -176,7 +171,7 @@ async def verifyNew(self, apiKey=None, userID=None):
wrCounter = False
runnerCounter = False
-
+
for i in pbs["data"]:
if i["place"] == 1:
if i["run"]["game"] == "yd4ovvg1" or i["run"]["game"] == "v1po7r76":
@@ -208,7 +203,7 @@ class Src(commands.Cog):
@commands.guild_only()
async def pending(self, ctx):
async with ctx.typing():
- await clear(self)
+ await self.bot.get_channel(int(self.bot.config[str(ctx.message.guild.id)]["pending_channel"])).purge(limit=500)
await pendingRuns(self, ctx)
@commands.command(description="Reject runs quickly")
@@ -231,9 +226,12 @@ class Src(commands.Cog):
@commands.command()
async def verify(self, ctx, apiKey=None, userID=None):
- #if apiKey == None:
- # await ctx.send(f"Please try again this command by getting an apiKey from https://www.speedrun.com/api/auth then do `{ctx.prefix}verify <apiKey>` in my DMs or anywhere in this server. \nBe careful who you share this key with. To learn more check out https://github.com/speedruncomorg/api/blob/master/authentication.md")
- # return
+ self.bot.messageBlacklist.append(ctx.message.id)
+ if apiKey == None:
+ data = json.loads(Path('./api_keys.json').read_text())
+ if not str(ctx.author.id) in data:
+ await ctx.send(f"Please try again this command by getting an apiKey from https://www.speedrun.com/api/auth then do `{ctx.prefix}verify <apiKey>` in my DMs or anywhere in this server. \nBe careful who you share this key with. To learn more check out https://github.com/speedruncomorg/api/blob/master/authentication.md")
+ return
if ctx.guild != None:
await ctx.message.delete()
async with ctx.typing():