@dressed/react 1.8.5-canary.2 → 1.8.5-canary.2.2
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,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ApplicationCommandType } from "discord-api-types/v10";
|
|
2
2
|
import { type CommandConfig, type CommandInteraction as DressedCommandInteraction, type MessageComponentInteraction as DressedMessageComponentInteraction, type ModalSubmitInteraction as DressedModalSubmitInteraction } from "dressed";
|
|
3
3
|
import type { createInteraction } from "dressed/server";
|
|
4
4
|
import { type ComponentType, type PropsWithChildren, type ReactNode } from "react";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { MessageFlags } from "discord-api-types/v10";
|
|
2
1
|
import { editWebhookMessage, } from "dressed";
|
|
3
2
|
import { createElement } from "react";
|
|
4
3
|
import { reconciler } from "../react/reconciler.js";
|
|
@@ -21,7 +20,7 @@ export function patchInteraction(interaction, parent) {
|
|
|
21
20
|
const original = interaction[method];
|
|
22
21
|
newInteraction[method] = (...[components, data = {}, $req]) => {
|
|
23
22
|
var _a;
|
|
24
|
-
data.flags = ((_a = data.flags) !== null && _a !== void 0 ? _a :
|
|
23
|
+
data.flags = ((_a = data.flags) !== null && _a !== void 0 ? _a : []).concat("IsComponentsV2");
|
|
25
24
|
let followUpId;
|
|
26
25
|
let pendingFollowUpEdit = false;
|
|
27
26
|
function editFollowUp() {
|
|
@@ -45,7 +44,7 @@ export function patchInteraction(interaction, parent) {
|
|
|
45
44
|
if (method === "followUp")
|
|
46
45
|
followUpId = 0;
|
|
47
46
|
const shouldEdit = (method === "reply" || method === "update") && interaction.history.includes(method);
|
|
48
|
-
const res = await (shouldEdit ? editReply : original)(data, $req);
|
|
47
|
+
const res = await (shouldEdit ? editReply : original)({ ...data }, $req);
|
|
49
48
|
if (method === "followUp") {
|
|
50
49
|
followUpId = res.id;
|
|
51
50
|
if (pendingFollowUpEdit)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interaction.js","sourceRoot":"","sources":["../../src/rendering/interaction.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"interaction.js","sourceRoot":"","sources":["../../src/rendering/interaction.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,kBAAkB,GACnB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAsB,aAAa,EAA0C,MAAM,OAAO,CAAC;AAClG,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAqDpC;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAC9B,WAAc,EACd,MAAyC;IAEzC,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC7B,IAAI,CAAC,WAAW;QAAE,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC;IACpD,yEAAyE;IACzE,MAAM,cAAc,GAAG,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE,GAAG,WAAW,EAAS,CAAC;IACzF,mBAAmB;IACnB,MAAM,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC;IACxC,KAAK,MAAM,MAAM,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,CAAgB,EAAE,CAAC;QAC9F,IAAI,CAAC,CAAC,MAAM,IAAI,WAAW,CAAC;YAAE,SAAS;QAEvC,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,CAA4B,CAAC;QAEhE,cAAc,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,GAAG,EAAE,EAAE,IAAI,CAA0C,EAAE,EAAE;;YACrG,IAAI,CAAC,KAAK,GAAG,CAAC,MAAA,IAAI,CAAC,KAAK,mCAAI,EAAE,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;YAEzD,IAA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C1B,UAAU,GAAG,GAAG,CAAC,EAAE,CAAC;wBACpB,IAAI,mBAAmB;4BAAE,YAAY,EAAE,CAAC;oBAC1C,CAAC;oBACD,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;gBAC/D,CAAC,CAAC,CAAC;gBACH,IAAI,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,gBAAgB,CAAA,EAAE,CAAC;oBAC5B,MAAA,MAAA,UAAU,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,SAAS,GAAG,GAAG,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,EAAC,KAAK,kDAAI,CAAC;gBAC7G,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;IACJ,CAAC;IACD,OAAO,cAAc,CAAC;AACxB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { APIMessage, Snowflake } from "discord-api-types/v10";
|
|
2
2
|
import { createMessage as dressedCreateMessage, editMessage as dressedEditMessage } from "dressed";
|
|
3
3
|
import type { CallConfig } from "dressed/utils";
|
|
4
4
|
import type { ReactNode } from "react";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { MessageFlags } from "discord-api-types/v10";
|
|
2
1
|
import { createMessage as dressedCreateMessage, editMessage as dressedEditMessage } from "dressed";
|
|
3
2
|
import { render } from "./index.js";
|
|
4
3
|
/**
|
|
@@ -7,7 +6,7 @@ import { render } from "./index.js";
|
|
|
7
6
|
*/
|
|
8
7
|
export function createMessage(channelId, components, data = {}, $req) {
|
|
9
8
|
var _a;
|
|
10
|
-
data.flags = ((_a = data.flags) !== null && _a !== void 0 ? _a :
|
|
9
|
+
data.flags = ((_a = data.flags) !== null && _a !== void 0 ? _a : []).concat("IsComponentsV2");
|
|
11
10
|
let messageId;
|
|
12
11
|
let pendingEdit = false;
|
|
13
12
|
function edit() {
|
|
@@ -42,7 +41,7 @@ export function createMessage(channelId, components, data = {}, $req) {
|
|
|
42
41
|
*/
|
|
43
42
|
export function editMessage(channelId, messageId, components, data = {}, $req) {
|
|
44
43
|
var _a;
|
|
45
|
-
data.flags = ((_a = data.flags) !== null && _a !== void 0 ? _a :
|
|
44
|
+
data.flags = ((_a = data.flags) !== null && _a !== void 0 ? _a : []).concat("IsComponentsV2");
|
|
46
45
|
return new Promise((resolve) => {
|
|
47
46
|
const { container } = render(components, async (c) => {
|
|
48
47
|
if (c.length === 0)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.js","sourceRoot":"","sources":["../../src/rendering/message.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"message.js","sourceRoot":"","sources":["../../src/rendering/message.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,IAAI,oBAAoB,EAAE,WAAW,IAAI,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAInG,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAapC;;;GAGG;AACH,MAAM,UAAU,aAAa,CAC3B,SAAoB,EACpB,UAAqB,EACrB,OAA+G,EAAE,EACjH,IAAiB;;IAEjB,IAAI,CAAC,KAAK,GAAG,CAAC,MAAA,IAAI,CAAC,KAAK,mCAAI,EAAE,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;IACzD,IAAI,SAAiC,CAAC;IACtC,IAAI,WAAW,GAAG,KAAK,CAAC;IAExB,SAAS,IAAI;QACX,IAAI,CAAC,SAAS;YAAE,OAAO;QACvB,OAAO,kBAAkB,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO,IAAI,OAAO,CAA4B,CAAC,OAAO,EAAE,EAAE;QACxD,MAAM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MAAM,kBAAkB,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;QAChH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dressed/react",
|
|
3
|
-
"version": "1.8.5-canary.2",
|
|
3
|
+
"version": "1.8.5-canary.2.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/Inbestigator/dressed.git",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"react-reconciler": "npm:@dressed/react-reconciler"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
|
-
"dressed": "^2.0.0-canary.2",
|
|
16
|
+
"dressed": "^2.0.0-canary.2.1",
|
|
17
17
|
"react": "^19.2.4"
|
|
18
18
|
},
|
|
19
19
|
"exports": {
|