Refactored lmgtfy

This commit is contained in:
Twentysix 2016-05-30 21:25:23 +02:00
parent 77bed58c45
commit 9e09b405b2

View File

@ -131,13 +131,10 @@ class General:
self.stopwatches.pop(author.id, None) self.stopwatches.pop(author.id, None)
@commands.command() @commands.command()
async def lmgtfy(self, *text): async def lmgtfy(self, *, search_terms : str):
"""Creates a lmgtfy link""" """Creates a lmgtfy link"""
if text == (): search_terms = search_terms.replace(" ", "+")
await self.bot.say("lmgtfy [search terms]") await self.bot.say("http://lmgtfy.com/?q={}".format(search_terms))
return
text = "+".join(text)
await self.bot.say("http://lmgtfy.com/?q=" + text)
@commands.command(no_pm=True, hidden=True) @commands.command(no_pm=True, hidden=True)
async def hug(self, user : discord.Member, intensity : int=1): async def hug(self, user : discord.Member, intensity : int=1):