APRK01 commited on
Commit Β·
628c8dc
1
Parent(s): 264934b
fix: resolve discord api interaction failures on massdrop dashboard
Browse files- src/systems/massdrop.js +34 -17
src/systems/massdrop.js
CHANGED
|
@@ -128,26 +128,36 @@ function generateDashboard(session) {
|
|
| 128 |
// though the core engine still processes all 50+.
|
| 129 |
const safeOptions = options.slice(0, 25);
|
| 130 |
|
| 131 |
-
const
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 137 |
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
|
|
|
|
|
|
|
|
|
| 144 |
|
| 145 |
-
|
| 146 |
-
new
|
| 147 |
-
|
|
|
|
|
|
|
| 148 |
);
|
| 149 |
|
| 150 |
-
return { embeds: [embed], components
|
| 151 |
}
|
| 152 |
|
| 153 |
/**
|
|
@@ -401,6 +411,13 @@ async function handleMassDropInteraction(interaction) {
|
|
| 401 |
return true;
|
| 402 |
}
|
| 403 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 404 |
if (customId === 'mass_deploy') {
|
| 405 |
session.step = 'deploying';
|
| 406 |
await interaction.update({
|
|
@@ -476,7 +493,7 @@ async function handleMassDropInteraction(interaction) {
|
|
| 476 |
})],
|
| 477 |
components: [
|
| 478 |
new ActionRowBuilder().addComponents(
|
| 479 |
-
new ButtonBuilder().setCustomId('
|
| 480 |
)
|
| 481 |
]
|
| 482 |
});
|
|
|
|
| 128 |
// though the core engine still processes all 50+.
|
| 129 |
const safeOptions = options.slice(0, 25);
|
| 130 |
|
| 131 |
+
const components = [];
|
| 132 |
+
|
| 133 |
+
if (safeOptions.length > 0) {
|
| 134 |
+
components.push(
|
| 135 |
+
new ActionRowBuilder().addComponents(
|
| 136 |
+
new StringSelectMenuBuilder()
|
| 137 |
+
.setCustomId('mass_select_edit')
|
| 138 |
+
.setPlaceholder('βοΈ Select a drop to edit text...')
|
| 139 |
+
.addOptions(safeOptions)
|
| 140 |
+
)
|
| 141 |
+
);
|
| 142 |
|
| 143 |
+
components.push(
|
| 144 |
+
new ActionRowBuilder().addComponents(
|
| 145 |
+
new StringSelectMenuBuilder()
|
| 146 |
+
.setCustomId('mass_select_image')
|
| 147 |
+
.setPlaceholder('πΌοΈ Select a drop to attach an image...')
|
| 148 |
+
.addOptions(safeOptions)
|
| 149 |
+
)
|
| 150 |
+
);
|
| 151 |
+
}
|
| 152 |
|
| 153 |
+
components.push(
|
| 154 |
+
new ActionRowBuilder().addComponents(
|
| 155 |
+
new ButtonBuilder().setCustomId('mass_deploy').setLabel(`Deploy ${session.files.length} Drops`).setStyle(ButtonStyle.Success).setEmoji('π'),
|
| 156 |
+
new ButtonBuilder().setCustomId('mass_cancel').setLabel('Cancel All').setStyle(ButtonStyle.Danger)
|
| 157 |
+
)
|
| 158 |
);
|
| 159 |
|
| 160 |
+
return { embeds: [embed], components };
|
| 161 |
}
|
| 162 |
|
| 163 |
/**
|
|
|
|
| 411 |
return true;
|
| 412 |
}
|
| 413 |
|
| 414 |
+
if (customId === 'mass_cancel_image') {
|
| 415 |
+
session.step = 'dashboard';
|
| 416 |
+
session.pendingImageIndex = null;
|
| 417 |
+
await interaction.update(generateDashboard(session));
|
| 418 |
+
return true;
|
| 419 |
+
}
|
| 420 |
+
|
| 421 |
if (customId === 'mass_deploy') {
|
| 422 |
session.step = 'deploying';
|
| 423 |
await interaction.update({
|
|
|
|
| 493 |
})],
|
| 494 |
components: [
|
| 495 |
new ActionRowBuilder().addComponents(
|
| 496 |
+
new ButtonBuilder().setCustomId('mass_cancel_image').setLabel('Cancel Attachment').setStyle(ButtonStyle.Secondary)
|
| 497 |
)
|
| 498 |
]
|
| 499 |
});
|