Skip to content

Commit

Permalink
Working with multiple rooms
Browse files Browse the repository at this point in the history
  • Loading branch information
sadasant committed Oct 17, 2012
1 parent 35ae329 commit abc3a7a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ controller.join = function(channel, nick) {
// Answering to user's messages
controller.message = function(from, to, message) {
message = message.toUpperCase()
if (to === bot.config.irc.channels[0] && ~message.indexOf(irc_nick_uppercased)) {
if (~bot.config.irc.channels.indexOf(to.toUpperCase())
&& ~message.indexOf(irc_nick_uppercased)
) {
message = message.replace(irc_nick_regex, '').trim()
if (message === '???') {
// Avoiding recursion when there are two bots in the room.
Expand Down
2 changes: 1 addition & 1 deletion example_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ exports.irc = {
nick : 'VEbot'
, password : 'password'
, server : 'irc.freenode.net'
, channels : ['#OpenVE']
, channels : ['#OPENVE'] // It must be in uppercase
}

exports.github = {
Expand Down

0 comments on commit abc3a7a

Please sign in to comment.