mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 19:43:29 +01:00
sendFile with content
This commit is contained in:
@@ -747,7 +747,7 @@ var InternalClient = (function () {
|
|||||||
|
|
||||||
// def sendFile
|
// def sendFile
|
||||||
|
|
||||||
InternalClient.prototype.sendFile = function sendFile(where, _file, name) {
|
InternalClient.prototype.sendFile = function sendFile(where, _file, name, content) {
|
||||||
var _this19 = this;
|
var _this19 = this;
|
||||||
|
|
||||||
if (!name) {
|
if (!name) {
|
||||||
@@ -765,7 +765,8 @@ var InternalClient = (function () {
|
|||||||
return _this19.resolver.resolveFile(_file).then(function (file) {
|
return _this19.resolver.resolveFile(_file).then(function (file) {
|
||||||
return _this19.apiRequest("post", _Constants.Endpoints.CHANNEL_MESSAGES(channel.id), true, null, {
|
return _this19.apiRequest("post", _Constants.Endpoints.CHANNEL_MESSAGES(channel.id), true, null, {
|
||||||
name: name,
|
name: name,
|
||||||
file: file
|
file: file,
|
||||||
|
content: content
|
||||||
}).then(function (res) {
|
}).then(function (res) {
|
||||||
return channel.messages.add(new _StructuresMessage2["default"](res, channel, _this19.client));
|
return channel.messages.add(new _StructuresMessage2["default"](res, channel, _this19.client));
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -611,7 +611,7 @@ export default class InternalClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// def sendFile
|
// def sendFile
|
||||||
sendFile(where, _file, name) {
|
sendFile(where, _file, name, content) {
|
||||||
if (!name) {
|
if (!name) {
|
||||||
if (_file instanceof String || typeof _file === "string") {
|
if (_file instanceof String || typeof _file === "string") {
|
||||||
name = require("path").basename(_file);
|
name = require("path").basename(_file);
|
||||||
@@ -629,7 +629,8 @@ export default class InternalClient {
|
|||||||
.then(file =>
|
.then(file =>
|
||||||
this.apiRequest("post", Endpoints.CHANNEL_MESSAGES(channel.id), true, null, {
|
this.apiRequest("post", Endpoints.CHANNEL_MESSAGES(channel.id), true, null, {
|
||||||
name,
|
name,
|
||||||
file
|
file,
|
||||||
|
content
|
||||||
}).then(res => channel.messages.add(new Message(res, channel, this.client)))
|
}).then(res => channel.messages.add(new Message(res, channel, this.client)))
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user