Skip to content

Commit

Permalink
Emit 'message#' for a channel message
Browse files Browse the repository at this point in the history
  • Loading branch information
alexwhitman committed Nov 17, 2011
1 parent b488e75 commit 7a4d6f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/API.rst
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,13 @@ Events
this clients nick and means a private message), or a channel (which means a
message to that channel). See the `raw` event for details on the `message` object.

.. js:data:: 'message#'

`function (nick, to, text, message) { }`

Emitted when a message is sent to a channel.
See the `raw` event for details on the `message` object.

.. js:data:: 'message#channel'

`function (nick, text, message) { }`
Expand Down
1 change: 1 addition & 0 deletions lib/irc.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ function Client(server, nick, opt) {
var text = message.args[1];
self.emit('message', from, to, text, message);
if ( to.match(/^[&#]/) ) {
self.emit('message#', from, to, text, message);
self.emit('message' + to, from, text, message);
if ( to != to.toLowerCase() ) {
self.emit('message' + to.toLowerCase(), from, text, message);
Expand Down

0 comments on commit 7a4d6f4

Please sign in to comment.