mirror of
https://github.com/danbulant/discord.js
synced 2026-06-24 17:21:59 +00:00
Webpack build for branch 11.1-dev: fd7cb41ee6
This commit is contained in:
parent
5ea6f19ae7
commit
dc1d096fef
2 changed files with 18 additions and 10 deletions
|
|
@ -7100,7 +7100,7 @@ class TextBasedChannel {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.files) {
|
if (options.files) {
|
||||||
for (const i in options.files) {
|
for (let i = 0; i < options.files.length; i++) {
|
||||||
let file = options.files[i];
|
let file = options.files[i];
|
||||||
if (typeof file === 'string') file = { attachment: file };
|
if (typeof file === 'string') file = { attachment: file };
|
||||||
if (!file.name) {
|
if (!file.name) {
|
||||||
|
|
@ -9727,14 +9727,22 @@ class Webhook {
|
||||||
options = {};
|
options = {};
|
||||||
}
|
}
|
||||||
if (options.file) {
|
if (options.file) {
|
||||||
if (typeof options.file === 'string') options.file = { attachment: options.file };
|
if (options.files) options.files.push(options.file);
|
||||||
if (!options.file.name) {
|
else options.files = [options.file];
|
||||||
if (typeof options.file.attachment === 'string') {
|
}
|
||||||
options.file.name = path.basename(options.file.attachment);
|
|
||||||
} else if (options.file.attachment && options.file.attachment.path) {
|
if (options.files) {
|
||||||
options.file.name = path.basename(options.file.attachment.path);
|
for (let i = 0; i < options.files.length; i++) {
|
||||||
} else {
|
let file = options.files[i];
|
||||||
options.file.name = 'file.jpg';
|
if (typeof file === 'string') file = { attachment: file };
|
||||||
|
if (!file.name) {
|
||||||
|
if (typeof file.attachment === 'string') {
|
||||||
|
file.name = path.basename(file.attachment);
|
||||||
|
} else if (file.attachment && file.attachment.path) {
|
||||||
|
file.name = path.basename(file.attachment.path);
|
||||||
|
} else {
|
||||||
|
file.name = 'file.jpg';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return this.client.resolver.resolveBuffer(options.file.attachment).then(file =>
|
return this.client.resolver.resolveBuffer(options.file.attachment).then(file =>
|
||||||
|
|
|
||||||
2
discord.11.1-dev.min.js
vendored
2
discord.11.1-dev.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue