mirror of
https://github.com/kennethreitz-archive/changebot.git
synced 2026-06-05 23:40:18 +00:00
help + ignore self
This commit is contained in:
+4
-1
@@ -79,7 +79,7 @@ hear = (pattern, callback) ->
|
||||
dispatch = (message) ->
|
||||
for pair in handlers
|
||||
[ pattern, handler ] = pair
|
||||
if match = message.message.match(pattern)
|
||||
if message.user.username isnt username and match = message.message.match(pattern)
|
||||
message.match = match
|
||||
message.say = (thing) -> say(message.topic.id, thing)
|
||||
handler(message)
|
||||
@@ -122,6 +122,9 @@ hear /feeling/, (message) ->
|
||||
hear /about/, (message) ->
|
||||
message.say "I am learning to love."
|
||||
|
||||
hear /help/, (message) ->
|
||||
message.say "I listen for '@#{username} image me PHRASE' and '@#{username} wiki me PHRASE'"
|
||||
|
||||
hear /wiki me (.*)/i, (message) ->
|
||||
term = escape(message.match[1])
|
||||
url = "http://en.wikipedia.org/w/api.php?action=opensearch&search=#{term}&format=json"
|
||||
|
||||
Reference in New Issue
Block a user