Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add plugin to change bot nick
  • Loading branch information
mmb committed May 20, 2011
1 parent 1eaf90e commit f9f757f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions lousybot.js
Expand Up @@ -62,6 +62,7 @@ function loadPlugins(path) {
}

var conn = net.createConnection(serverPort, host=serverHost);
conn.botNick = botNick;
conn.messageBuffer = '';

conn.sendMessage = function (command, text) {
Expand Down
13 changes: 13 additions & 0 deletions plugins/botnick.js
@@ -0,0 +1,13 @@
// change the bot's nick: !botnick newnick

function botnick(m) {
if (m.text.match(/^!botnick /)) {
var newNick = m.text.substr(9);

this.sendMessage('NICK', newNick);
this.botNick = newNick;
}
}

exports.channelMessage = botnick;
exports.privateMessage = botnick;

0 comments on commit f9f757f

Please sign in to comment.