seyfert 3.2.7-dev-18548278191.0 → 3.2.7-dev-18548619376.0
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.
|
@@ -20,6 +20,7 @@ export interface Attachment extends ObjectToLower<APIAttachment> {
|
|
|
20
20
|
export declare class Attachment extends Base {
|
|
21
21
|
data: APIAttachment;
|
|
22
22
|
constructor(client: UsingClient, data: APIAttachment);
|
|
23
|
+
toJSON(): APIAttachment;
|
|
23
24
|
}
|
|
24
25
|
export declare class AttachmentBuilder {
|
|
25
26
|
data: Partial<AttachmentData>;
|
|
@@ -86,11 +86,15 @@ class BaseInteraction extends DiscordBase_1.DiscordBase {
|
|
|
86
86
|
poll: poll ? (poll instanceof builders_1.PollBuilder ? poll.toJSON() : poll) : undefined,
|
|
87
87
|
};
|
|
88
88
|
if (Array.isArray(body.attachments)) {
|
|
89
|
-
payload.attachments =
|
|
90
|
-
|
|
89
|
+
payload.attachments = body.attachments.map((x, i) => {
|
|
90
|
+
if (x instanceof builders_1.Attachment) {
|
|
91
|
+
return x.toJSON();
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
91
94
|
id: x.id ?? i.toString(),
|
|
92
95
|
...(0, builders_1.resolveAttachment)(x),
|
|
93
|
-
}
|
|
96
|
+
};
|
|
97
|
+
});
|
|
94
98
|
}
|
|
95
99
|
else if (files?.length) {
|
|
96
100
|
payload.attachments = files?.map(({ filename }, i) => ({
|
|
@@ -531,13 +535,12 @@ let ModalSubmitInteraction = class ModalSubmitInteraction extends BaseInteractio
|
|
|
531
535
|
if (attachments) {
|
|
532
536
|
return Object.values(attachments).map(x => new builders_1.Attachment(this.client, {
|
|
533
537
|
...x,
|
|
534
|
-
proxy_url: x.url
|
|
538
|
+
proxy_url: x.url,
|
|
535
539
|
}));
|
|
536
540
|
}
|
|
537
541
|
}
|
|
538
542
|
return undefined;
|
|
539
543
|
}
|
|
540
|
-
;
|
|
541
544
|
isModal() {
|
|
542
545
|
return true;
|
|
543
546
|
}
|
|
@@ -215,10 +215,15 @@ class MessagesMethods extends DiscordBase_1.DiscordBase {
|
|
|
215
215
|
};
|
|
216
216
|
if ('attachments' in body) {
|
|
217
217
|
payload.attachments =
|
|
218
|
-
body.attachments?.map((x, i) =>
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
218
|
+
body.attachments?.map((x, i) => {
|
|
219
|
+
if (x instanceof builders_1.Attachment) {
|
|
220
|
+
return x.toJSON();
|
|
221
|
+
}
|
|
222
|
+
return {
|
|
223
|
+
id: i.toString(),
|
|
224
|
+
...(0, builders_1.resolveAttachment)(x),
|
|
225
|
+
};
|
|
226
|
+
}) ?? undefined;
|
|
222
227
|
}
|
|
223
228
|
else if (files?.length) {
|
|
224
229
|
payload.attachments = files?.map(({ filename }, i) => ({
|