@minesa-org/mini-interaction 0.3.5 → 0.3.6
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 { InteractionResponseType, } from "discord-api-types/v10";
|
|
2
2
|
import { normaliseInteractionMessageData, normaliseMessageFlags, } from "./interactionMessageHelpers.js";
|
|
3
3
|
export const ModalSubmitInteraction = {};
|
|
4
4
|
/**
|
|
@@ -65,9 +65,11 @@ export function createModalSubmitInteraction(interaction, helpers) {
|
|
|
65
65
|
const getTextFieldValue = (customId) => {
|
|
66
66
|
for (const actionRow of interaction.data.components) {
|
|
67
67
|
if ("components" in actionRow && Array.isArray(actionRow.components)) {
|
|
68
|
-
for (const
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
for (const rawComponent of actionRow.components) {
|
|
69
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
70
|
+
const component = rawComponent;
|
|
71
|
+
if (component.custom_id === customId &&
|
|
72
|
+
typeof component.value === "string") {
|
|
71
73
|
return component.value;
|
|
72
74
|
}
|
|
73
75
|
}
|
|
@@ -81,12 +83,8 @@ export function createModalSubmitInteraction(interaction, helpers) {
|
|
|
81
83
|
for (const rawComponent of actionRow.components) {
|
|
82
84
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
83
85
|
const component = rawComponent;
|
|
84
|
-
if (
|
|
85
|
-
component.
|
|
86
|
-
component.type === ComponentType.RoleSelect ||
|
|
87
|
-
component.type === ComponentType.MentionableSelect ||
|
|
88
|
-
component.type === ComponentType.ChannelSelect) &&
|
|
89
|
-
component.custom_id === customId) {
|
|
86
|
+
if (component.custom_id === customId &&
|
|
87
|
+
Array.isArray(component.values)) {
|
|
90
88
|
return component.values;
|
|
91
89
|
}
|
|
92
90
|
}
|
package/package.json
CHANGED