@sapphire/discord.js-utilities 7.3.2 → 7.3.3-next.5d7bdbbc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +20 -20
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.mjs +20 -20
- package/dist/esm/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/cjs/index.cjs
CHANGED
|
@@ -311,7 +311,7 @@ var _MessagePrompterBaseStrategy = class _MessagePrompterBaseStrategy {
|
|
|
311
311
|
this.type = type;
|
|
312
312
|
this.timeout = options?.timeout ?? _MessagePrompterBaseStrategy.defaultStrategyOptions.timeout ?? 10 * 1e3;
|
|
313
313
|
this.explicitReturn = options?.explicitReturn ?? _MessagePrompterBaseStrategy.defaultStrategyOptions.explicitReturn ?? false;
|
|
314
|
-
this.editMessage = options?.editMessage ?? _MessagePrompterBaseStrategy.defaultStrategyOptions.editMessage ??
|
|
314
|
+
this.editMessage = options?.editMessage ?? _MessagePrompterBaseStrategy.defaultStrategyOptions.editMessage ?? undefined;
|
|
315
315
|
this.message = message;
|
|
316
316
|
}
|
|
317
317
|
async collectReactions(channel, authorOrFilter, reactions) {
|
|
@@ -372,7 +372,7 @@ __name(_MessagePrompterBaseStrategy, "MessagePrompterBaseStrategy");
|
|
|
372
372
|
__publicField(_MessagePrompterBaseStrategy, "defaultStrategyOptions", {
|
|
373
373
|
timeout: 10 * 1e3,
|
|
374
374
|
explicitReturn: false,
|
|
375
|
-
editMessage:
|
|
375
|
+
editMessage: undefined
|
|
376
376
|
});
|
|
377
377
|
var MessagePrompterBaseStrategy = _MessagePrompterBaseStrategy;
|
|
378
378
|
|
|
@@ -848,7 +848,7 @@ var _PaginatedMessage = class _PaginatedMessage {
|
|
|
848
848
|
* @returns The resolved template as a BaseMessageOptions object.
|
|
849
849
|
*/
|
|
850
850
|
static resolveTemplate(template) {
|
|
851
|
-
if (template ===
|
|
851
|
+
if (template === undefined) {
|
|
852
852
|
return {};
|
|
853
853
|
}
|
|
854
854
|
if (discord_js.isJSONEncodable(template)) {
|
|
@@ -1614,7 +1614,7 @@ var _PaginatedMessage = class _PaginatedMessage {
|
|
|
1614
1614
|
if (this.response.replied || this.response.deferred) {
|
|
1615
1615
|
await this.response.editReply(page);
|
|
1616
1616
|
} else {
|
|
1617
|
-
await this.response.reply({ ...page, content: page.content ??
|
|
1617
|
+
await this.response.reply({ ...page, content: page.content ?? undefined });
|
|
1618
1618
|
}
|
|
1619
1619
|
} else if (isMessageInstance(this.response)) {
|
|
1620
1620
|
await this.response.edit(page);
|
|
@@ -1626,13 +1626,13 @@ var _PaginatedMessage = class _PaginatedMessage {
|
|
|
1626
1626
|
} else {
|
|
1627
1627
|
this.response = await messageOrInteraction.reply({
|
|
1628
1628
|
...page,
|
|
1629
|
-
content: page.content ??
|
|
1629
|
+
content: page.content ?? undefined,
|
|
1630
1630
|
fetchReply: true,
|
|
1631
1631
|
ephemeral: false
|
|
1632
1632
|
});
|
|
1633
1633
|
}
|
|
1634
1634
|
} else if (isTextBasedChannel(messageOrInteraction.channel)) {
|
|
1635
|
-
this.response = await messageOrInteraction.channel.send({ ...page, content: page.content ??
|
|
1635
|
+
this.response = await messageOrInteraction.channel.send({ ...page, content: page.content ?? undefined });
|
|
1636
1636
|
}
|
|
1637
1637
|
}
|
|
1638
1638
|
/**
|
|
@@ -1654,7 +1654,7 @@ var _PaginatedMessage = class _PaginatedMessage {
|
|
|
1654
1654
|
return false;
|
|
1655
1655
|
}, "filter"),
|
|
1656
1656
|
time: this.idle,
|
|
1657
|
-
guild: isGuildBasedChannel(messageOrInteraction.channel) ? messageOrInteraction.channel.guild :
|
|
1657
|
+
guild: isGuildBasedChannel(messageOrInteraction.channel) ? messageOrInteraction.channel.guild : undefined,
|
|
1658
1658
|
channel: messageOrInteraction.channel,
|
|
1659
1659
|
interactionType: discord_js.InteractionType.MessageComponent,
|
|
1660
1660
|
...!utilities.isNullish(this.response) && !isAnyInteraction(this.response) ? {
|
|
@@ -1826,8 +1826,8 @@ var _PaginatedMessage = class _PaginatedMessage {
|
|
|
1826
1826
|
user: targetUser,
|
|
1827
1827
|
channel: messageOrInteraction.channel,
|
|
1828
1828
|
guild: isGuildBasedChannel(messageOrInteraction.channel) ? messageOrInteraction.channel.guild : null,
|
|
1829
|
-
interactionGuildLocale: isAnyInteraction(messageOrInteraction) ? messageOrInteraction.guildLocale :
|
|
1830
|
-
interactionLocale: isAnyInteraction(messageOrInteraction) ? messageOrInteraction.locale :
|
|
1829
|
+
interactionGuildLocale: isAnyInteraction(messageOrInteraction) ? messageOrInteraction.guildLocale : undefined,
|
|
1830
|
+
interactionLocale: isAnyInteraction(messageOrInteraction) ? messageOrInteraction.locale : undefined
|
|
1831
1831
|
};
|
|
1832
1832
|
return context;
|
|
1833
1833
|
}
|
|
@@ -1854,7 +1854,7 @@ var _PaginatedMessage = class _PaginatedMessage {
|
|
|
1854
1854
|
*/
|
|
1855
1855
|
applyTemplateEmbed(templateEmbed, pageEmbeds) {
|
|
1856
1856
|
if (utilities.isNullish(pageEmbeds)) {
|
|
1857
|
-
return templateEmbed ? [templateEmbed?.[0]] :
|
|
1857
|
+
return templateEmbed ? [templateEmbed?.[0]] : undefined;
|
|
1858
1858
|
}
|
|
1859
1859
|
if (utilities.isNullish(templateEmbed)) {
|
|
1860
1860
|
return pageEmbeds;
|
|
@@ -1874,17 +1874,17 @@ var _PaginatedMessage = class _PaginatedMessage {
|
|
|
1874
1874
|
for (const pageEmbed of pageEmbeds) {
|
|
1875
1875
|
const pageJson = discord_js.isJSONEncodable(pageEmbed) ? pageEmbed.toJSON() : pageEmbed;
|
|
1876
1876
|
mergedEmbeds.push({
|
|
1877
|
-
title: pageJson.title ?? jsonTemplate.title ??
|
|
1878
|
-
description: pageJson.description ?? jsonTemplate.description ??
|
|
1879
|
-
url: pageJson.url ?? jsonTemplate.url ??
|
|
1880
|
-
timestamp: (typeof pageJson.timestamp === "string" ? new Date(pageJson.timestamp).toISOString() : pageJson.timestamp) ?? (typeof jsonTemplate.timestamp === "string" ? new Date(jsonTemplate.timestamp).toISOString() : jsonTemplate.timestamp) ??
|
|
1881
|
-
color: pageJson.color ?? jsonTemplate.color ??
|
|
1877
|
+
title: pageJson.title ?? jsonTemplate.title ?? undefined,
|
|
1878
|
+
description: pageJson.description ?? jsonTemplate.description ?? undefined,
|
|
1879
|
+
url: pageJson.url ?? jsonTemplate.url ?? undefined,
|
|
1880
|
+
timestamp: (typeof pageJson.timestamp === "string" ? new Date(pageJson.timestamp).toISOString() : pageJson.timestamp) ?? (typeof jsonTemplate.timestamp === "string" ? new Date(jsonTemplate.timestamp).toISOString() : jsonTemplate.timestamp) ?? undefined,
|
|
1881
|
+
color: pageJson.color ?? jsonTemplate.color ?? undefined,
|
|
1882
1882
|
fields: this.mergeArrays(jsonTemplate.fields, pageJson.fields),
|
|
1883
|
-
author: pageJson.author ?? jsonTemplate.author ??
|
|
1884
|
-
thumbnail: pageJson.thumbnail ?? jsonTemplate.thumbnail ??
|
|
1885
|
-
image: pageJson.image ?? jsonTemplate.image ??
|
|
1886
|
-
video: pageJson.video ?? jsonTemplate.video ??
|
|
1887
|
-
footer: pageJson.footer ?? jsonTemplate.footer ??
|
|
1883
|
+
author: pageJson.author ?? jsonTemplate.author ?? undefined,
|
|
1884
|
+
thumbnail: pageJson.thumbnail ?? jsonTemplate.thumbnail ?? undefined,
|
|
1885
|
+
image: pageJson.image ?? jsonTemplate.image ?? undefined,
|
|
1886
|
+
video: pageJson.video ?? jsonTemplate.video ?? undefined,
|
|
1887
|
+
footer: pageJson.footer ?? jsonTemplate.footer ?? undefined
|
|
1888
1888
|
});
|
|
1889
1889
|
}
|
|
1890
1890
|
return mergedEmbeds;
|