@sapphire/discord.js-utilities 7.3.2 → 7.3.3-next.42db0795
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/esm/index.mjs
CHANGED
|
@@ -310,7 +310,7 @@ var _MessagePrompterBaseStrategy = class _MessagePrompterBaseStrategy {
|
|
|
310
310
|
this.type = type;
|
|
311
311
|
this.timeout = options?.timeout ?? _MessagePrompterBaseStrategy.defaultStrategyOptions.timeout ?? 10 * 1e3;
|
|
312
312
|
this.explicitReturn = options?.explicitReturn ?? _MessagePrompterBaseStrategy.defaultStrategyOptions.explicitReturn ?? false;
|
|
313
|
-
this.editMessage = options?.editMessage ?? _MessagePrompterBaseStrategy.defaultStrategyOptions.editMessage ??
|
|
313
|
+
this.editMessage = options?.editMessage ?? _MessagePrompterBaseStrategy.defaultStrategyOptions.editMessage ?? undefined;
|
|
314
314
|
this.message = message;
|
|
315
315
|
}
|
|
316
316
|
async collectReactions(channel, authorOrFilter, reactions) {
|
|
@@ -371,7 +371,7 @@ __name(_MessagePrompterBaseStrategy, "MessagePrompterBaseStrategy");
|
|
|
371
371
|
__publicField(_MessagePrompterBaseStrategy, "defaultStrategyOptions", {
|
|
372
372
|
timeout: 10 * 1e3,
|
|
373
373
|
explicitReturn: false,
|
|
374
|
-
editMessage:
|
|
374
|
+
editMessage: undefined
|
|
375
375
|
});
|
|
376
376
|
var MessagePrompterBaseStrategy = _MessagePrompterBaseStrategy;
|
|
377
377
|
|
|
@@ -847,7 +847,7 @@ var _PaginatedMessage = class _PaginatedMessage {
|
|
|
847
847
|
* @returns The resolved template as a BaseMessageOptions object.
|
|
848
848
|
*/
|
|
849
849
|
static resolveTemplate(template) {
|
|
850
|
-
if (template ===
|
|
850
|
+
if (template === undefined) {
|
|
851
851
|
return {};
|
|
852
852
|
}
|
|
853
853
|
if (isJSONEncodable(template)) {
|
|
@@ -1613,7 +1613,7 @@ var _PaginatedMessage = class _PaginatedMessage {
|
|
|
1613
1613
|
if (this.response.replied || this.response.deferred) {
|
|
1614
1614
|
await this.response.editReply(page);
|
|
1615
1615
|
} else {
|
|
1616
|
-
await this.response.reply({ ...page, content: page.content ??
|
|
1616
|
+
await this.response.reply({ ...page, content: page.content ?? undefined });
|
|
1617
1617
|
}
|
|
1618
1618
|
} else if (isMessageInstance(this.response)) {
|
|
1619
1619
|
await this.response.edit(page);
|
|
@@ -1625,13 +1625,13 @@ var _PaginatedMessage = class _PaginatedMessage {
|
|
|
1625
1625
|
} else {
|
|
1626
1626
|
this.response = await messageOrInteraction.reply({
|
|
1627
1627
|
...page,
|
|
1628
|
-
content: page.content ??
|
|
1628
|
+
content: page.content ?? undefined,
|
|
1629
1629
|
fetchReply: true,
|
|
1630
1630
|
ephemeral: false
|
|
1631
1631
|
});
|
|
1632
1632
|
}
|
|
1633
1633
|
} else if (isTextBasedChannel(messageOrInteraction.channel)) {
|
|
1634
|
-
this.response = await messageOrInteraction.channel.send({ ...page, content: page.content ??
|
|
1634
|
+
this.response = await messageOrInteraction.channel.send({ ...page, content: page.content ?? undefined });
|
|
1635
1635
|
}
|
|
1636
1636
|
}
|
|
1637
1637
|
/**
|
|
@@ -1653,7 +1653,7 @@ var _PaginatedMessage = class _PaginatedMessage {
|
|
|
1653
1653
|
return false;
|
|
1654
1654
|
}, "filter"),
|
|
1655
1655
|
time: this.idle,
|
|
1656
|
-
guild: isGuildBasedChannel(messageOrInteraction.channel) ? messageOrInteraction.channel.guild :
|
|
1656
|
+
guild: isGuildBasedChannel(messageOrInteraction.channel) ? messageOrInteraction.channel.guild : undefined,
|
|
1657
1657
|
channel: messageOrInteraction.channel,
|
|
1658
1658
|
interactionType: InteractionType.MessageComponent,
|
|
1659
1659
|
...!isNullish(this.response) && !isAnyInteraction(this.response) ? {
|
|
@@ -1825,8 +1825,8 @@ var _PaginatedMessage = class _PaginatedMessage {
|
|
|
1825
1825
|
user: targetUser,
|
|
1826
1826
|
channel: messageOrInteraction.channel,
|
|
1827
1827
|
guild: isGuildBasedChannel(messageOrInteraction.channel) ? messageOrInteraction.channel.guild : null,
|
|
1828
|
-
interactionGuildLocale: isAnyInteraction(messageOrInteraction) ? messageOrInteraction.guildLocale :
|
|
1829
|
-
interactionLocale: isAnyInteraction(messageOrInteraction) ? messageOrInteraction.locale :
|
|
1828
|
+
interactionGuildLocale: isAnyInteraction(messageOrInteraction) ? messageOrInteraction.guildLocale : undefined,
|
|
1829
|
+
interactionLocale: isAnyInteraction(messageOrInteraction) ? messageOrInteraction.locale : undefined
|
|
1830
1830
|
};
|
|
1831
1831
|
return context;
|
|
1832
1832
|
}
|
|
@@ -1853,7 +1853,7 @@ var _PaginatedMessage = class _PaginatedMessage {
|
|
|
1853
1853
|
*/
|
|
1854
1854
|
applyTemplateEmbed(templateEmbed, pageEmbeds) {
|
|
1855
1855
|
if (isNullish(pageEmbeds)) {
|
|
1856
|
-
return templateEmbed ? [templateEmbed?.[0]] :
|
|
1856
|
+
return templateEmbed ? [templateEmbed?.[0]] : undefined;
|
|
1857
1857
|
}
|
|
1858
1858
|
if (isNullish(templateEmbed)) {
|
|
1859
1859
|
return pageEmbeds;
|
|
@@ -1873,17 +1873,17 @@ var _PaginatedMessage = class _PaginatedMessage {
|
|
|
1873
1873
|
for (const pageEmbed of pageEmbeds) {
|
|
1874
1874
|
const pageJson = isJSONEncodable(pageEmbed) ? pageEmbed.toJSON() : pageEmbed;
|
|
1875
1875
|
mergedEmbeds.push({
|
|
1876
|
-
title: pageJson.title ?? jsonTemplate.title ??
|
|
1877
|
-
description: pageJson.description ?? jsonTemplate.description ??
|
|
1878
|
-
url: pageJson.url ?? jsonTemplate.url ??
|
|
1879
|
-
timestamp: (typeof pageJson.timestamp === "string" ? new Date(pageJson.timestamp).toISOString() : pageJson.timestamp) ?? (typeof jsonTemplate.timestamp === "string" ? new Date(jsonTemplate.timestamp).toISOString() : jsonTemplate.timestamp) ??
|
|
1880
|
-
color: pageJson.color ?? jsonTemplate.color ??
|
|
1876
|
+
title: pageJson.title ?? jsonTemplate.title ?? undefined,
|
|
1877
|
+
description: pageJson.description ?? jsonTemplate.description ?? undefined,
|
|
1878
|
+
url: pageJson.url ?? jsonTemplate.url ?? undefined,
|
|
1879
|
+
timestamp: (typeof pageJson.timestamp === "string" ? new Date(pageJson.timestamp).toISOString() : pageJson.timestamp) ?? (typeof jsonTemplate.timestamp === "string" ? new Date(jsonTemplate.timestamp).toISOString() : jsonTemplate.timestamp) ?? undefined,
|
|
1880
|
+
color: pageJson.color ?? jsonTemplate.color ?? undefined,
|
|
1881
1881
|
fields: this.mergeArrays(jsonTemplate.fields, pageJson.fields),
|
|
1882
|
-
author: pageJson.author ?? jsonTemplate.author ??
|
|
1883
|
-
thumbnail: pageJson.thumbnail ?? jsonTemplate.thumbnail ??
|
|
1884
|
-
image: pageJson.image ?? jsonTemplate.image ??
|
|
1885
|
-
video: pageJson.video ?? jsonTemplate.video ??
|
|
1886
|
-
footer: pageJson.footer ?? jsonTemplate.footer ??
|
|
1882
|
+
author: pageJson.author ?? jsonTemplate.author ?? undefined,
|
|
1883
|
+
thumbnail: pageJson.thumbnail ?? jsonTemplate.thumbnail ?? undefined,
|
|
1884
|
+
image: pageJson.image ?? jsonTemplate.image ?? undefined,
|
|
1885
|
+
video: pageJson.video ?? jsonTemplate.video ?? undefined,
|
|
1886
|
+
footer: pageJson.footer ?? jsonTemplate.footer ?? undefined
|
|
1887
1887
|
});
|
|
1888
1888
|
}
|
|
1889
1889
|
return mergedEmbeds;
|