diff --git a/bin/cmd.js b/bin/cmd.js index 0394828..6678bf4 100755 --- a/bin/cmd.js +++ b/bin/cmd.js @@ -355,9 +355,9 @@ var cmd = function () { }); }], - 'uploadFile': [ 'groupId', 'channelId', function (callback, pipe) { + 'uploadFile': [ 'groupId', 'channelId', 'userId', function (callback, pipe) { logger.debug('uploadFile'); - + if (!options.file) { return callback(); } @@ -370,6 +370,9 @@ var cmd = function () { else if (!options.group && options.channel) { id = pipe.channelId; } + else if(options.direct_message){ + id = pipe.userId; + } var formData = { channel: id, @@ -405,6 +408,9 @@ var cmd = function () { else if (!options.group && options.channel) { id = pipe.channelId; } + else if(options.direct_message){ + id = pipe.userId; + } var form = { channel: id,