aboutsummaryrefslogtreecommitdiff
path: root/cogs
diff options
context:
space:
mode:
authorAnInternetTroll <lucafulger@gmail.com>2020-06-27 12:58:25 +0000
committerAnInternetTroll <lucafulger@gmail.com>2020-06-27 12:58:25 +0000
commit6368eb4cadde12083d085ea5b65be752e1e1dd15 (patch)
treec64b60638b0ce5321581ad87c9a15e32b41277c3 /cogs
parentdcfc891b717abd0cbb0e8b1348ec7459c7ff150b (diff)
downloadsteve-bot-6368eb4cadde12083d085ea5b65be752e1e1dd15.tar
steve-bot-6368eb4cadde12083d085ea5b65be752e1e1dd15.tar.gz
steve-bot-6368eb4cadde12083d085ea5b65be752e1e1dd15.tar.bz2
steve-bot-6368eb4cadde12083d085ea5b65be752e1e1dd15.tar.lz
steve-bot-6368eb4cadde12083d085ea5b65be752e1e1dd15.tar.xz
steve-bot-6368eb4cadde12083d085ea5b65be752e1e1dd15.tar.zst
steve-bot-6368eb4cadde12083d085ea5b65be752e1e1dd15.zip
Fixed translation mentions
Diffstat (limited to 'cogs')
-rw-r--r--cogs/src.py10
-rw-r--r--cogs/trans.py3
2 files changed, 8 insertions, 5 deletions
diff --git a/cogs/src.py b/cogs/src.py
index f0619d4..ff31cfb 100644
--- a/cogs/src.py
+++ b/cogs/src.py
@@ -208,7 +208,7 @@ class Src(commands.Cog):
@commands.guild_only()
async def pending(self, ctx):
async with ctx.typing():
- await self.bot.get_channel(699713639866957905).purge()
+ await self.bot.get_channel(699713639866957905).purge(limit=500)
await pendingRuns(self, ctx)
@commands.command(description="Reject runs quickly")
@@ -232,9 +232,11 @@ class Src(commands.Cog):
@commands.command()
async def verify(self, ctx, apiKey=None, userID=None):
self.bot.messageBlacklist.append(ctx.message.id)
- #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
+ 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():
diff --git a/cogs/trans.py b/cogs/trans.py
index 2c6ed71..9c5d307 100644
--- a/cogs/trans.py
+++ b/cogs/trans.py
@@ -20,6 +20,7 @@ async def translateMsg(text, target="en"):
result['translatedText'] = result['translatedText'].replace("&#39;", "'")
result['translatedText'] = result['translatedText'].replace("&quot;", '"')
result['translatedText'] = result['translatedText'].replace("<@! ", "<@!")
+ result['translatedText'] = result['translatedText'].replace("<@ ", "<@")
result['translatedText'] = result['translatedText'].replace("<# ", "<#")
return result;
@@ -28,7 +29,7 @@ class Trans(commands.Cog):
def __init__(self, bot):
self.bot = bot
- @commands.command(help="Translate text in english (using google translate)", brief="Translate to english")
+ @commands.command(help="Translate text in english (using google translate)", brief="Translate to english", aliases=["翻译", "脑热", "动漫"])
async def translate(self, ctx, *, message):
response = await translateMsg(message)
embed=discord.Embed(title="Translation",description=f"{ctx.message.author.mention} says:", timestamp=ctx.message.created_at, color=0x4d9aff)