Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Implemented NOTICE command. No flood protection, though. Fixes gf3/IR…

…C-js#40.

Signed-off-by: Gianni Chiappetta <gianni@runlevel6.org>
  • Loading branch information...
commit 450368c12e800eb3909d8afe2e2ca38681892969 1 parent ee6e8c4
@jsyrjala jsyrjala authored gf3 committed
Showing with 16 additions and 0 deletions.
  1. +16 −0 lib/irc.js
View
16 lib/irc.js
@@ -678,6 +678,22 @@ function IRC( options ) {
function privmsg ( receiver, msg ) {
this.raw( 'PRIVMSG' + param( receiver ) + ' ' + param( msg || '', null, ':' ) )
}
+
+ /**
+ * IRC#notice( receiver, message) -> self
+ *
+ * Send a notice to user or a channel.
+ *
+ * ### Examples
+ *
+ * irc_instance.notice( '#asl', 'It is past midnight, time to go to bed.' )
+ **/
+ this.notice = function( receiver, msg) {
+ // 4.4.2
+ // TODO flood protection, maybe privmsg and notice should use same queue
+ this.raw( 'NOTICE' + param( receiver ) + ' ' + param( msg || '', null, ':' ) )
+ return this
+ }
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.