@minesa-org/mini-interaction 0.2.0 → 0.2.1

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.
@@ -1,7 +1,7 @@
1
- /** Flags available for interaction responses. */
2
1
  export declare enum InteractionFlags {
3
2
  Ephemeral = 64,
4
- IsComponentsV2 = 32768
3
+ IsComponentsV2 = 32768,
4
+ SuppressEmbeds = 4
5
5
  }
6
6
  /** @deprecated Use InteractionFlags instead. */
7
7
  export { InteractionFlags as InteractionReplyFlags };
@@ -1,8 +1,8 @@
1
- /** Flags available for interaction responses. */
2
1
  export var InteractionFlags;
3
2
  (function (InteractionFlags) {
4
3
  InteractionFlags[InteractionFlags["Ephemeral"] = 64] = "Ephemeral";
5
4
  InteractionFlags[InteractionFlags["IsComponentsV2"] = 32768] = "IsComponentsV2";
5
+ InteractionFlags[InteractionFlags["SuppressEmbeds"] = 4] = "SuppressEmbeds";
6
6
  })(InteractionFlags || (InteractionFlags = {}));
7
7
  /** @deprecated Use InteractionFlags instead. */
8
8
  export { InteractionFlags as InteractionReplyFlags };
@@ -11,7 +11,7 @@ export type InteractionMessageData = {
11
11
  content?: string;
12
12
  components?: TopLevelComponent[] | JSONEncodable<TopLevelComponent>[] | JSONEncodable<TopLevelComponent[]>;
13
13
  embeds?: unknown[];
14
- flags?: InteractionFlags;
14
+ flags?: MessageFlagLike | MessageFlagLike[];
15
15
  };
16
16
  /** Deferred response payload recognised by helper methods. */
17
17
  export type DeferredResponseData = {
@@ -49,6 +49,9 @@ export function normaliseInteractionMessageData(data) {
49
49
  if (data.embeds) {
50
50
  responseData.embeds = data.embeds.map((e) => resolveJSONEncodable(e));
51
51
  }
52
+ if (data.flags !== undefined) {
53
+ responseData.flags = normaliseMessageFlags(data.flags);
54
+ }
52
55
  return responseData;
53
56
  }
54
57
  function containsComponentsV2(components) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minesa-org/mini-interaction",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Mini interaction, connecting your app with Discord via HTTP-interaction (Vercel support).",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",