Skip to content

Commit

Permalink
lib/events: Fix send message not sending if username null
Browse files Browse the repository at this point in the history
  • Loading branch information
sogehige committed Mar 21, 2018
1 parent 920a603 commit af215b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/events.js
Expand Up @@ -181,7 +181,7 @@ class Events {

async fireSendChatMessageOrWhisper (operation, attributes, whisper) {
const d = debug('events:fireSendChatMessageOrWhisper')
let username = _.get(attributes, 'username', global.parser.getOwner())
let username = _.isNil(attributes.username) ? global.parser.getOwner() : attributes.username
let message = operation.messageToSend
_.each(attributes, function (val, name) {
if (_.isObject(val) && _.size(val) === 0) return true // skip empty object
Expand Down

0 comments on commit af215b2

Please sign in to comment.