Type fixes + circular dependency fix
This commit is contained in:
parent
e3b6b017a2
commit
59e75e0584
20 changed files with 70 additions and 83 deletions
|
@ -49,24 +49,18 @@ export const ButtonInteractionEvt = reactionRolesEvt({
|
|||
const group = cfg.button_groups[context.groupName];
|
||||
if (!group) {
|
||||
await sendEphemeralReply(int, `A configuration error was encountered, please contact the Administrators!`);
|
||||
meta.pluginData
|
||||
.getPlugin(LogsPlugin)
|
||||
.log(
|
||||
LogType.BOT_ALERT,
|
||||
`**A configuration error occurred** on buttons for message ${int.message.id}, group **${context.groupName}** not found in config`,
|
||||
);
|
||||
meta.pluginData.getPlugin(LogsPlugin).logBotAlert({
|
||||
body: `**A configuration error occurred** on buttons for message ${int.message.id}, group **${context.groupName}** not found in config`,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// Verify that detected action is known by us
|
||||
if (!(<any>Object).values(ButtonMenuActions).includes(context.action)) {
|
||||
await sendEphemeralReply(int, `A internal error was encountered, please contact the Administrators!`);
|
||||
meta.pluginData
|
||||
.getPlugin(LogsPlugin)
|
||||
.log(
|
||||
LogType.BOT_ALERT,
|
||||
`**A internal error occurred** on buttons for message ${int.message.id}, action **${context.action}** is not known`,
|
||||
);
|
||||
meta.pluginData.getPlugin(LogsPlugin).logBotAlert({
|
||||
body: `**A internal error occurred** on buttons for message ${int.message.id}, action **${context.action}** is not known`,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,12 +18,9 @@ export async function handleOpenMenu(
|
|||
content: `A configuration error was encountered, please contact the Administrators!`,
|
||||
ephemeral: true,
|
||||
});
|
||||
pluginData
|
||||
.getPlugin(LogsPlugin)
|
||||
.log(
|
||||
LogType.BOT_ALERT,
|
||||
`**A configuration error occurred** on buttons for message ${int.message.id}, no menus found in config`,
|
||||
);
|
||||
pluginData.getPlugin(LogsPlugin).logBotAlert({
|
||||
body: `**A configuration error occurred** on buttons for message ${int.message.id}, no menus found in config`,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -48,12 +45,9 @@ export async function handleOpenMenu(
|
|||
content: `A configuration error was encountered, please contact the Administrators!`,
|
||||
ephemeral: true,
|
||||
});
|
||||
pluginData
|
||||
.getPlugin(LogsPlugin)
|
||||
.log(
|
||||
LogType.BOT_ALERT,
|
||||
`**A configuration error occurred** on buttons for message ${int.message.id}, menu **${context.roleOrMenu}** not found in config`,
|
||||
);
|
||||
pluginData.getPlugin(LogsPlugin).logBotAlert({
|
||||
body: `**A configuration error occurred** on buttons for message ${int.message.id}, menu **${context.roleOrMenu}** not found in config`,
|
||||
});
|
||||
return;
|
||||
}
|
||||
const rows = splitButtonsIntoRows(menuButtons, Object.values(group.button_menus[context.roleOrMenu])); // new MessageActionRow().addComponents(menuButtons);
|
||||
|
@ -73,12 +67,9 @@ export async function handleModifyRole(
|
|||
content: `A configuration error was encountered, please contact the Administrators!`,
|
||||
ephemeral: true,
|
||||
});
|
||||
pluginData
|
||||
.getPlugin(LogsPlugin)
|
||||
.log(
|
||||
LogType.BOT_ALERT,
|
||||
`**A configuration error occurred** on buttons for message ${int.message.id}, role **${context.roleOrMenu}** not found on server`,
|
||||
);
|
||||
pluginData.getPlugin(LogsPlugin).logBotAlert({
|
||||
body: `**A configuration error occurred** on buttons for message ${int.message.id}, role **${context.roleOrMenu}** not found on server`,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -96,11 +87,8 @@ export async function handleModifyRole(
|
|||
content: "A configuration error was encountered, please contact the Administrators!",
|
||||
ephemeral: true,
|
||||
});
|
||||
pluginData
|
||||
.getPlugin(LogsPlugin)
|
||||
.log(
|
||||
LogType.BOT_ALERT,
|
||||
`**A configuration error occurred** on buttons for message ${int.message.id}, error: ${e}. We might be missing permissions!`,
|
||||
);
|
||||
pluginData.getPlugin(LogsPlugin).logBotAlert({
|
||||
body: `**A configuration error occurred** on buttons for message ${int.message.id}, error: ${e}. We might be missing permissions!`,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue