aboutsummaryrefslogtreecommitdiff
path: root/cogs/trans.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/trans.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/trans.py')
-rwxr-xr-xcogs/trans.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/cogs/trans.py b/cogs/trans.py
index 2c6ed71..9ca1004 100755
--- 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,8 +29,9 @@ 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):
+ """Translate to english"""
response = await translateMsg(message)
embed=discord.Embed(title="Translation",description=f"{ctx.message.author.mention} says:", timestamp=ctx.message.created_at, color=0x4d9aff)
embed.add_field(name=f"[{response['detectedSourceLanguage']}] Source:" , value=response['input'], inline=False)
@@ -38,6 +40,7 @@ class Trans(commands.Cog):
@commands.command()
async def trans(self, ctx, lan, *, message):
+ """Translate to a specific language"""
response = await translateMsg(message, lan)
embed=discord.Embed(title="Translation",description=f"{ctx.message.author.mention} says:", timestamp=ctx.message.created_at, color=0x4d9aff)
embed.add_field(name=f"[{response['detectedSourceLanguage']}] Source:" , value=response['input'], inline=False)