revbot.js 0.0.4 → 0.0.5

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/index.js CHANGED
@@ -2589,6 +2589,7 @@ var MessageManager = class extends BaseManager {
2589
2589
  return __async(this, null, function* () {
2590
2590
  if (typeof content === "string") content = { content };
2591
2591
  let attachments = [];
2592
+ let embeds = [];
2592
2593
  if (Array.isArray(content.attachments)) {
2593
2594
  const promises = content.attachments.map((att) => __async(this, null, function* () {
2594
2595
  const data = new import_form_data.default();
@@ -2614,10 +2615,13 @@ var MessageManager = class extends BaseManager {
2614
2615
  }));
2615
2616
  yield Promise.all(promises);
2616
2617
  }
2618
+ if (Array.isArray(content.embeds)) {
2619
+ content.embeds.map((embed) => embeds.push(embed.toJSON()));
2620
+ }
2617
2621
  const resp = yield this.client.api.post(
2618
2622
  `/channels/${this.channel.id}/messages`,
2619
2623
  {
2620
- body: __spreadProps(__spreadValues({}, content), { attachments, nonce: UUID.generate() })
2624
+ body: __spreadProps(__spreadValues({}, content), { attachments, embeds, nonce: UUID.generate() })
2621
2625
  }
2622
2626
  );
2623
2627
  return this._add(resp);
package/dist/index.mjs CHANGED
@@ -2516,6 +2516,7 @@ var MessageManager = class extends BaseManager {
2516
2516
  return __async(this, null, function* () {
2517
2517
  if (typeof content === "string") content = { content };
2518
2518
  let attachments = [];
2519
+ let embeds = [];
2519
2520
  if (Array.isArray(content.attachments)) {
2520
2521
  const promises = content.attachments.map((att) => __async(this, null, function* () {
2521
2522
  const data = new FormData();
@@ -2541,10 +2542,13 @@ var MessageManager = class extends BaseManager {
2541
2542
  }));
2542
2543
  yield Promise.all(promises);
2543
2544
  }
2545
+ if (Array.isArray(content.embeds)) {
2546
+ content.embeds.map((embed) => embeds.push(embed.toJSON()));
2547
+ }
2544
2548
  const resp = yield this.client.api.post(
2545
2549
  `/channels/${this.channel.id}/messages`,
2546
2550
  {
2547
- body: __spreadProps(__spreadValues({}, content), { attachments, nonce: UUID.generate() })
2551
+ body: __spreadProps(__spreadValues({}, content), { attachments, embeds, nonce: UUID.generate() })
2548
2552
  }
2549
2553
  );
2550
2554
  return this._add(resp);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "revbot.js",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "A Revolt bot client used to interact with the revolt api for Node.js, written in TypeScript.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -19,7 +19,7 @@
19
19
  ],
20
20
  "homepage": "https://jade3375.github.io/revbot.js/",
21
21
  "author": "Jade3375",
22
- "license": "MIT License",
22
+ "license": "MIT",
23
23
  "packageManager": "yarn@4.9.1",
24
24
  "devDependencies": {
25
25
  "@mxssfd/typedoc-theme": "^1.1.7",