[General] fixed [p]lmgtfy when search contains '+' (#1868)

A plus in an equation is interpreted as a space by https://lmgtfy.com which breaks the equation. Fixed by escaping plus characters in the search terms.
This commit is contained in:
ToxicFrazzles 2018-08-13 03:00:54 +01:00 committed by Toby Harradine
parent e19328188b
commit 15bf5c5e1f

View File

@ -154,7 +154,7 @@ class General:
@commands.command()
async def lmgtfy(self, *, search_terms : str):
"""Creates a lmgtfy link"""
search_terms = escape_mass_mentions(search_terms.replace(" ", "+"))
search_terms = escape_mass_mentions(search_terms.replace("+","%2B").replace(" ", "+"))
await self.bot.say("https://lmgtfy.com/?q={}".format(search_terms))
@commands.command(no_pm=True, hidden=True)