Skip to content

Commit

Permalink
added: Method to explicitly PM a user, fixes #5.
Browse files Browse the repository at this point in the history
  • Loading branch information
gf3 committed Apr 26, 2011
1 parent 32cc4a3 commit 62f8d72
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@ The jerk object (`j`) has only one method: `watch_for`. Which takes two argument
, source: String
, match_data: Array
, say: Function( message )
, msg: Function( message )
}
```

One thing I will tell you though, is the `say` method is smart enough to reply to the context that the message was received, so you don't need to pass it any extra info, just a reply :)
One thing I will tell you though, is the `say` method is smart enough to reply to the context that the message was received, so you don't need to pass it any extra info, just a reply :) However, the `msg` method can be used if you'd like to force sending a message directly to a user (aka a PM).

The `connect` method returns an object with some handy methods that you can use outside of your `watch_for`s:

Expand Down
1 change: 1 addition & 0 deletions lib/jerk.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ Jerk = new ( function Jerk() {
if ( md = text.match( watchers[i][0] ) )
watchers[i][1](
{ say: _privmsg_protected.bind( this, source )
, msg: _privmsg_protected.bind( this, message.person.nick )
, match_data: md
, user: message.person.nick
, source: source
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
, "Arnaud Berthomier <oz@cyprio.net> (http://wtf.cyprio.net)"
]
, "homepage" : "http://github.com/gf3/Jerk"
, "version" : "1.1.9"
, "version" : "1.1.10"
, "main" : "./lib/jerk"
, "dependencies" :
{ "irc-js": "=0.2.17"
Expand Down

0 comments on commit 62f8d72

Please sign in to comment.