Skip to content

Commit

Permalink
fixed an issue where bot cannot say an array
Browse files Browse the repository at this point in the history
  • Loading branch information
ralfschiffert committed Oct 29, 2019
1 parent a8a428a commit 5007a9f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -857,13 +857,10 @@ Bot.prototype.say = function(format, message) {
format = _.toLower(args.shift());
}

// if message is object (raw)
if(typeof args[0] === 'object') {
return this.spark.messageSendRoom(this.room.id, args[0]);
}


// if message is string
else if(typeof args[0] === 'string') {
else if(typeof args[0] === 'string' || Array.isArray(args[0])) {
// apply string formatters to remaining arguments
message = util.format.apply(null, args);

Expand All @@ -879,6 +876,10 @@ Bot.prototype.say = function(format, message) {

// send constructed message object to room
return this.spark.messageSendRoom(this.room.id, messageObj);
}
// if message is object (raw)
else if(typeof args[0] === 'object') {
return this.spark.messageSendRoom(this.room.id, args[0]);
}

else {
Expand Down

0 comments on commit 5007a9f

Please sign in to comment.