Skip to content

Commit

Permalink
[Translate] 2.3.7 Fix issue where translating messages from another c…
Browse files Browse the repository at this point in the history
…hannel could throw an error where it shouldn't

- sorry mart
  • Loading branch information
TrustyJAID committed Mar 24, 2021
1 parent a78570b commit c739903
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions translate/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Translate(GoogleTranslateAPI, commands.Cog):
"""

__author__ = ["Aziz", "TrustyJAID"]
__version__ = "2.3.6"
__version__ = "2.3.7"

def __init__(self, bot):
self.bot = bot
Expand Down Expand Up @@ -155,12 +155,12 @@ async def translate(
if ctx.channel.permissions_for(ctx.me).embed_links:
translation = (translated_text, from_lang, to_language)
em = await self.translation_embed(author, translation, requestor)
if version_info >= VersionInfo.from_str("3.4.6"):
if version_info >= VersionInfo.from_str("3.4.6") and msg.channel.id == ctx.channel.id:
await ctx.send(embed=em, reference=msg, mention_author=False)
else:
await ctx.send(embed=em)
else:
if version_info >= VersionInfo.from_str("3.4.6"):
if version_info >= VersionInfo.from_str("3.4.6") and msg.channel.id == ctx.channel.id:
await ctx.send(translated_text, reference=msg, mention_author=False)
else:
await ctx.send(translated_text)
Expand Down

0 comments on commit c739903

Please sign in to comment.