Skip to content
This repository has been archived by the owner on Jul 25, 2018. It is now read-only.

Commit

Permalink
The bot can target a screen now.
Browse files Browse the repository at this point in the history
That was easier than expected.
  • Loading branch information
mythmon committed Jan 11, 2013
1 parent 8aa9493 commit 1a1d094
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions chat.js
Expand Up @@ -32,13 +32,18 @@ ircClient.addListener('message', function(from, to, message) {

match = IRC_TARGET_RE.exec(message);
var url;
var screen_name = null;
if (match) {
url = match[1];
args = match[1].split(' ');
url = args[0];
if (args[1]) {
screen_name = args.slice(1).join(' ');
}
} else if (from == 'dashbot') {
url = message;
}
if(url) {
manager.setUrl(url, null, function(opts) {
manager.setUrl(url, screen_name, function(opts) {
if (opts['message']) {
ircClient.say(to, opts['message']);
}
Expand Down

0 comments on commit 1a1d094

Please sign in to comment.