diff --git a/plugins/Google.py b/plugins/Google.py index 082d90a08..1d0106f42 100644 --- a/plugins/Google.py +++ b/plugins/Google.py @@ -211,6 +211,18 @@ class Google(callbacks.PrivmsgCommandAndRegexp): else: return '%s: %s' % (time, '; '.join(results)) + def lucky(self, irc, msg, args): + """ + + Does a google search, but only returns the first result. + """ + data = search(self.log, args) + if data.results: + url = data.results[0].URL + irc.reply(url) + else: + irc.reply('Google found nothing.') + def google(self, irc, msg, args): """ [--{language,restrict}=] [--{notsafe,similar}]