seyfert 3.2.7-dev-18548278191.0 → 3.2.7-dev-18548516169.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>;
@@ -21,6 +21,9 @@ class Attachment extends Base_1.Base {
21
21
  this.data = data;
22
22
  this.__patchThis(data);
23
23
  }
24
+ toJSON() {
25
+ return { ...this.data };
26
+ }
24
27
  }
25
28
  exports.Attachment = Attachment;
26
29
  class AttachmentBuilder {
@@ -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
- id: i.toString(),
220
- ...(0, builders_1.resolveAttachment)(x),
221
- })) ?? undefined;
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) => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seyfert",
3
- "version": "3.2.7-dev-18548278191.0",
3
+ "version": "3.2.7-dev-18548516169.0",
4
4
  "description": "The most advanced framework for discord bots",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",