mirror of
https://github.com/danbulant/discord.js
synced 2026-06-18 22:21:17 +00:00
Webpack build for branch 11.3-dev: 6d70da5b1e
This commit is contained in:
parent
e8f339bf7c
commit
edb3d00d37
2 changed files with 37 additions and 3 deletions
|
|
@ -5800,6 +5800,8 @@ class TextBasedChannel {
|
|||
else options.files = [options.file];
|
||||
}
|
||||
|
||||
if (options.embed) options.embed = new RichEmbed(options.embed)._apiTransform();
|
||||
|
||||
if (options.files) {
|
||||
for (let i = 0; i < options.files.length; i++) {
|
||||
let file = options.files[i];
|
||||
|
|
@ -8595,7 +8597,7 @@ class RichEmbed {
|
|||
|
||||
/**
|
||||
* Timestamp for this Embed
|
||||
* @type {Date}
|
||||
* @type {number}
|
||||
*/
|
||||
this.timestamp = data.timestamp;
|
||||
|
||||
|
|
@ -8689,7 +8691,7 @@ class RichEmbed {
|
|||
|
||||
/**
|
||||
* Sets the timestamp of this embed.
|
||||
* @param {Date} [timestamp=current date] The timestamp
|
||||
* @param {Date} [timestamp=new Date()] The timestamp
|
||||
* @returns {RichEmbed} This embed
|
||||
*/
|
||||
setTimestamp(timestamp = new Date()) {
|
||||
|
|
@ -8771,6 +8773,36 @@ class RichEmbed {
|
|||
this.file = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Transforms the embed object to be processed.
|
||||
* @returns {Object} The raw data of this embed
|
||||
* @private
|
||||
*/
|
||||
_apiTransform() {
|
||||
return {
|
||||
title: this.title,
|
||||
type: 'rich',
|
||||
description: this.description,
|
||||
url: this.url,
|
||||
timestamp: this.timestamp ? new Date(this.timestamp) : null,
|
||||
color: this.color,
|
||||
fields: this.fields,
|
||||
thumbnail: this.thumbnail,
|
||||
image: this.image ? {
|
||||
url: this.image.url,
|
||||
} : null,
|
||||
author: this.author ? {
|
||||
name: this.author.name,
|
||||
url: this.author.url,
|
||||
icon_url: this.author.iconURL,
|
||||
} : null,
|
||||
footer: this.footer ? {
|
||||
text: this.footer.text,
|
||||
icon_url: this.footer.iconURL,
|
||||
} : null,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = RichEmbed;
|
||||
|
|
@ -10558,6 +10590,8 @@ class Webhook {
|
|||
else options.files = files;
|
||||
}
|
||||
|
||||
if (options.embeds) options.embeds = options.embeds.map(e => new RichEmbed(e)._apiTransform());
|
||||
|
||||
if (options.files) {
|
||||
for (let i = 0; i < options.files.length; i++) {
|
||||
let file = options.files[i];
|
||||
|
|
|
|||
2
discord.11.3-dev.min.js
vendored
2
discord.11.3-dev.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue