mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
sendFile via URL
This commit is contained in:
@@ -583,16 +583,18 @@ var InternalClient = (function () {
|
||||
// fs.createReadStream()'s have .path that give the path. Not sure about other streams though.
|
||||
name = require("path").basename(_file.path);
|
||||
} else {
|
||||
name = "image.png"; // Just have to go with default filenames.
|
||||
name = "default.png"; // Just have to go with default filenames.
|
||||
}
|
||||
}
|
||||
|
||||
return this.resolver.resolveChannel(where).then(function (channel) {
|
||||
return _this15.apiRequest("post", _Constants.Endpoints.CHANNEL_MESSAGES(channel.id), true, null, {
|
||||
name: name,
|
||||
file: _this15.resolver.resolveFile(_file)
|
||||
}).then(function (res) {
|
||||
return channel.messages.add(new _StructuresMessage2["default"](res, channel, _this15.client));
|
||||
return _this15.resolver.resolveFile(_file).then(function (file) {
|
||||
return _this15.apiRequest("post", _Constants.Endpoints.CHANNEL_MESSAGES(channel.id), true, null, {
|
||||
name: name,
|
||||
file: file
|
||||
}).then(function (res) {
|
||||
return channel.messages.add(new _StructuresMessage2["default"](res, channel, _this15.client));
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user