update lang_convert method
@@ -9,16 +9,14 @@ class Fun(commands.Cog):
self.bot = bot
self.g = self.bot.get_cog("Global")
- async def lang_convert(self, ctx, msg, lang): # Goes through message and replaces all instances of keys with their values in a dict
- keys = list(lang)
- mes = ""
- for letter in discord.utils.escape_mentions(msg).lower():
- if letter in keys:
- mes += lang[letter]
- else:
- mes += letter
- if len(mes) > 2000:
- await ctx.send(embed=discord.Embed(color=discord.Color.green(), description="Uh oh, your message is too long to convert."))
+ async def lang_convert(self, ctx, msg,
+ lang): # Goes through message and replaces all instances of keys with their values in a dict
+ for key in keys:
+ msg = msg.replace(key, lang[key])
+
+ if len(msg) > 2000:
+ await ctx.send(embed=discord.Embed(color=discord.Color.green(),
+ description="Uh oh, your message is too long to convert."))
else:
await ctx.send(mes)
