Skip to content

Commit 83d2230

Browse files
committed
FINALLY IT WORKS FOR REAL
1 parent f1751e8 commit 83d2230

File tree

14 files changed

+16
-16
lines changed

14 files changed

+16
-16
lines changed

Commands/ContextCommands/RoleMenus/Delete_Role_Menu.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export const ContextCommand = {
5656
// Grab data
5757
const SourceMessage = interaction.data.resolved.messages[interaction.data.target_id];
5858
const SourceComponents = SourceMessage.components;
59-
let checkForMenuType = SourceComponents[0].components.find(comp => comp.id === 30);
59+
let checkForMenuType = SourceComponents[0].components.find(comp => comp.id === 8);
6060

6161

6262
// Validate Command was used on a Role Menu by this App

Commands/ContextCommands/RoleMenus/Edit_Role_Menu.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export const ContextCommand = {
5757
// Grab data
5858
const SourceMessage = interaction.data.resolved.messages[interaction.data.target_id];
5959
const SourceComponents = SourceMessage.components;
60-
let checkForMenuType = SourceComponents[0].components.find(comp => comp.id === 30);
60+
let checkForMenuType = SourceComponents[0].components.find(comp => comp.id === 8);
6161

6262

6363
// Validate Command was used on a Role Menu by this App

Commands/SlashCommands/RoleMenus/rolemenu.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ export const SlashCommand = {
197197
"content": `-# ${localize(interaction.guild_locale, 'ROLE_MENU_REQUIREMENTS_PLACEHOLDER')}`
198198
},
199199
{
200-
"id": 30,
200+
"id": 8,
201201
"type": ComponentType.TextDisplay,
202202
"content": localize('en-GB', 'ROLE_MENU_MENU_TYPE_PLACEHOLDER')
203203
}

Interactions/Buttons/RoleMenus/role.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ async function grantRevokeRole(interaction) {
7474
// Check for menu requirements
7575
const SourceMessage = interaction.message;
7676
const SourceComponents = SourceMessage.components;
77-
let findMenuType = SourceComponents[0].components.find(component => component.id === 30);
77+
let findMenuType = SourceComponents[0].components.find(component => component.id === 8);
7878
const SourceMenuType = findMenuType != undefined ? findMenuType.content.split(": ").pop() : undefined;
7979
let menuRequirementComponent = SourceComponents[0].components.find(component => component.id === 7);
8080

Interactions/Modals/RoleMenus/menu-add-requirement.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export const Modal = {
5858
});
5959

6060
// Validation against Requirements
61-
if ( MenuRequirements.includes(inputSelectedRole) ) {
61+
if ( MenuRequirements.includes(`<@&${inputSelectedRole}>`) ) {
6262
return new JsonResponse({
6363
type: InteractionResponseType.ChannelMessageWithSource,
6464
data: {

Interactions/Modals/RoleMenus/menu-add-role.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export const Modal = {
123123
// This is the very first button on the Menu
124124
MenuButtons.push({
125125
"type": ComponentType.ActionRow,
126-
"id": 8,
126+
"id": 9,
127127
"components": [newMenuButton]
128128
});
129129
}
@@ -168,7 +168,7 @@ export const Modal = {
168168
// Edit into Menu
169169
for ( let i = 0; i <= MenuButtons.length - 1; i++ ) {
170170
// This mess is just so I can pull each updated row out of MenuButtons and into MenuContainer.components, without having an Array where a Component Object should be
171-
MenuContainer.components.splice(4 + i, 1, MenuButtons[i]);
171+
MenuContainer.components.splice(5 + i, 1, MenuButtons[i]);
172172
}
173173

174174
MenuContainer.components.forEach(comp => {

Interactions/Modals/RoleMenus/menu-edit-button.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export const Modal = {
8484
// Edit into Menu
8585
for ( let i = 0; i <= MenuButtons.length - 1; i++ ) {
8686
// This mess is just so I can pull each updated row out of MenuButtons and into MenuContainer.components, without having an Array where a Component Object should be
87-
MenuContainer.components.splice(4 + i, 1, MenuButtons[i]);
87+
MenuContainer.components.splice(5 + i, 1, MenuButtons[i]);
8888
}
8989

9090
MenuContainer.components.forEach(comp => {

Interactions/Modals/RoleMenus/menu-remove-requirement.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const Modal = {
4949

5050

5151
// Validate selected Role *is* an added Requirement that can be removed
52-
if ( !(MenuRequirements.includes(inputSelectedRole)) ) {
52+
if ( !(MenuRequirements.includes(`<@&${inputSelectedRole}>`)) ) {
5353
return new JsonResponse({
5454
type: InteractionResponseType.ChannelMessageWithSource,
5555
data: {

Interactions/Modals/RoleMenus/menu-remove-role.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export const Modal = {
9191
// This is the very first button on the Menu
9292
updatedMenuButtons.push({
9393
"type": ComponentType.ActionRow,
94-
"id": 8,
94+
"id": 9,
9595
"components": [button]
9696
});
9797
}
@@ -140,7 +140,7 @@ export const Modal = {
140140
// Edit into Menu
141141
for ( let i = 0; i <= MenuButtons.length - 1; i++ ) {
142142
// This mess is just so I can pull each updated row out of MenuButtons and into MenuContainer.components, without having an Array where a Component Object should be
143-
MenuContainer.components.splice(4 + i, 1, MenuButtons[i]);
143+
MenuContainer.components.splice(5 + i, 1, MenuButtons[i]);
144144
}
145145

146146
MenuContainer.components.forEach(comp => {

Interactions/Modals/RoleMenus/menu-set-details.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const Modal = {
3131
if ( ModalComponents[i].type === ComponentType.Label ) {
3232
let tempTopLevelComp = ModalComponents[i].component;
3333
if ( tempTopLevelComp.custom_id === "menu-title" ) { inputMenuTitle = tempTopLevelComp.value; }
34-
if ( tempTopLevelComp.custom_id === "menu-description" ) { inputMenuDescription = tempTopLevelComp.value ?? "\u200B"; }
34+
if ( tempTopLevelComp.custom_id === "menu-description" ) { inputMenuDescription = tempTopLevelComp.value ?? "** **"; }
3535
if ( tempTopLevelComp.custom_id === "menu-color" ) { inputMenuSidebarColor = tempTopLevelComp.value ?? undefined; }
3636
}
3737
}

0 commit comments

Comments
 (0)