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

Function disableCategory

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

Source from the content-addressed store, hash-verified

255}
256
257export async function disableCategory(client, guildId, categoryKey, context = {}) {
258 const normalizedKey = normalizeCategoryKey(categoryKey);
259 const category = getCategoryRegistry(client, normalizedKey);
260
261 if (!category) {
262 throw new Error(`Unknown category: \`${categoryKey}\`.`);
263 }
264
265 const config = await getGuildConfig(client, guildId, context);
266 const disabledCategories = normalizeToggleRecord(config?.disabledCategories);
267 disabledCategories[normalizedKey] = true;
268
269 await persistAccessConfig(client, guildId, { disabledCategories }, context);
270 return { categoryKey: normalizedKey, displayName: category.displayName, enabled: false };
271}
272
273export async function enableCategory(client, guildId, categoryKey, context = {}) {
274 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