Fixed message sending
This commit is contained in:
parent
ed800dbd81
commit
912ba3b711
10
app.js
10
app.js
|
@ -32,9 +32,15 @@ var client = new irc.Client(config.irc.server, config.irc.nick, {
|
|||
var handleMessage = function (from, to, message) {
|
||||
logger.info(from + ' => ' + to + ': ' + message)
|
||||
|
||||
pluginManager.testPlugins(message).then(function (results) {
|
||||
pluginManager.testPlugins(message).then((results) => {
|
||||
for (var i = 0; i < results.length; i++) {
|
||||
client.say(to, results[i])
|
||||
logger.info('BOT => ' + results[i].to + ': ' + message)
|
||||
// TODO handle TO (nick/channel
|
||||
if (results[i].to === 'nick') {
|
||||
to = from
|
||||
}
|
||||
|
||||
client.say(to, results[i].message)
|
||||
}
|
||||
}, function (error) {
|
||||
logger.error('Plugin error: ', error)
|
||||
|
|
Loading…
Reference in New Issue
Block a user