Skip to content

Instantly share code, notes, and snippets.

@ebith
Created January 10, 2013 20:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ebith/4505583 to your computer and use it in GitHub Desktop.
Save ebith/4505583 to your computer and use it in GitHub Desktop.
hubot-ircでmsg.noticeが使えるように戻すパッチ。v0.1.4用
diff --git a/src/irc.coffee b/src/irc.coffee
index 1cd6be3..dbfb495 100644
--- a/src/irc.coffee
+++ b/src/irc.coffee
@@ -5,6 +5,12 @@
Irc = require 'irc'
class IrcBot extends Adapter
+ constructor: (@robot) ->
+ super @robot
+ @robot.notice = (user, strings...) ->
+ @adapter.notice user, strings...
+ @robot.Response = IrcResponse
+
send: (user, strings...) ->
for str in strings
if not str?
@@ -176,5 +182,9 @@ class IrcBot extends Adapter
self.emit "connected"
+class IrcResponse extends Response
+ notice: (strings...) ->
+ @robot.adapter.notice @message.user, strings...
+
exports.use = (robot) ->
new IrcBot robot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment