3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-07-08 11:37:20 +00:00
zeppelin/backend/src/plugins/RoleButtons/functions/getAllRolesInButtons.ts
2024-04-09 20:57:18 +03:00

10 lines
381 B
TypeScript

import { TRoleButtonsConfigItem } from "../types.js";
// This function will be more complex in the future when the plugin supports select menus + sub-menus
export function getAllRolesInButtons(buttons: TRoleButtonsConfigItem): string[] {
const roles = new Set<string>();
for (const option of buttons.options) {
roles.add(option.role_id);
}
return Array.from(roles);
}