Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 22 lines (20 sloc) 0.44 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
# Description:
# Tell Hubot to send a user a link to lmgtfy.com
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
# hubot lmgtfy <optional @username> <some query>
#
# Author:
# phlipper

module.exports = (robot) ->
   robot.respond /lmgtfy?\s?(?:@(\w*))? (.*)/i, (msg) ->
     link = ""
     link += "#{msg.match[1]}: " if msg.match[1]
     link += "http://lmgtfy.com/?q=#{escape(msg.match[2])}"
     msg.send link
Something went wrong with that request. Please try again.