@minesa-org/mini-interaction 0.3.3 → 0.3.4
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.
|
@@ -325,10 +325,12 @@ export function createCommandInteraction(interaction, helpers) {
|
|
|
325
325
|
typeof data.toJSON === "function"
|
|
326
326
|
? data.toJSON()
|
|
327
327
|
: data;
|
|
328
|
-
|
|
328
|
+
const response = captureResponse({
|
|
329
329
|
type: InteractionResponseType.Modal,
|
|
330
330
|
data: resolvedData,
|
|
331
331
|
});
|
|
332
|
+
this.onAck?.(response);
|
|
333
|
+
return response;
|
|
332
334
|
},
|
|
333
335
|
async withTimeoutProtection(operation, deferOptions) {
|
|
334
336
|
const startTime = Date.now();
|
|
@@ -84,10 +84,12 @@ function createContextMenuInteractionHelpers(interaction, helpers) {
|
|
|
84
84
|
};
|
|
85
85
|
const showModal = (data) => {
|
|
86
86
|
const modalData = typeof data === "object" && "toJSON" in data ? data.toJSON() : data;
|
|
87
|
-
|
|
87
|
+
const response = captureResponse({
|
|
88
88
|
type: InteractionResponseType.Modal,
|
|
89
89
|
data: modalData,
|
|
90
90
|
});
|
|
91
|
+
helpers?.onAck?.(response);
|
|
92
|
+
return response;
|
|
91
93
|
};
|
|
92
94
|
const getResponse = () => capturedResponse;
|
|
93
95
|
return {
|
|
@@ -103,10 +103,12 @@ export function createMessageComponentInteraction(interaction, helpers) {
|
|
|
103
103
|
typeof data.toJSON === "function"
|
|
104
104
|
? data.toJSON()
|
|
105
105
|
: data;
|
|
106
|
-
|
|
106
|
+
const response = captureResponse({
|
|
107
107
|
type: InteractionResponseType.Modal,
|
|
108
108
|
data: resolvedData,
|
|
109
109
|
});
|
|
110
|
+
helpers?.onAck?.(response);
|
|
111
|
+
return response;
|
|
110
112
|
};
|
|
111
113
|
const editReply = async (data) => {
|
|
112
114
|
if (helpers?.canRespond && !helpers.canRespond(interaction.id)) {
|
package/package.json
CHANGED