MCPcopy Index your code
hub / github.com/codebymitch/TitanBot / enableCategory

Function enableCategory

src/services/commandAccessService.js:273–287  ·  view source on GitHub ↗
(client, guildId, categoryKey, context = {})

Source from the content-addressed store, hash-verified

271}
272
273export async function enableCategory(client, guildId, categoryKey, context = {}) {
274 const normalizedKey = normalizeCategoryKey(categoryKey);
275 const category = getCategoryRegistry(client, normalizedKey);
276
277 if (!category) {
278 throw new Error(`Unknown category: \`${categoryKey}\`.`);
279 }
280
281 const config = await getGuildConfig(client, guildId, context);
282 const disabledCategories = normalizeToggleRecord(config?.disabledCategories);
283 delete disabledCategories[normalizedKey];
284
285 await persistAccessConfig(client, guildId, { disabledCategories }, context);
286 return { categoryKey: normalizedKey, displayName: category.displayName, enabled: true };
287}
288
289export async function resetCategoryCommands(client, guildId, categoryKey, context = {}) {
290 const normalizedKey = normalizeCategoryKey(categoryKey);

Callers 2

executeFunction · 0.90
handleDashboardComponentFunction · 0.90

Calls 5

normalizeCategoryKeyFunction · 0.90
getGuildConfigFunction · 0.90
getCategoryRegistryFunction · 0.85
normalizeToggleRecordFunction · 0.85
persistAccessConfigFunction · 0.85

Tested by

no test coverage detected