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

Function resetCategoryCommands

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

Source from the content-addressed store, hash-verified

287}
288
289export async function resetCategoryCommands(client, guildId, categoryKey, context = {}) {
290 const normalizedKey = normalizeCategoryKey(categoryKey);
291 const category = getCategoryRegistry(client, normalizedKey);
292
293 if (!category) {
294 throw new Error(`Unknown category: \`${categoryKey}\`.`);
295 }
296
297 const config = await getGuildConfig(client, guildId, context);
298 const disabledCommands = normalizeToggleRecord(config?.disabledCommands);
299
300 for (const command of category.commands) {
301 delete disabledCommands[command.name.toLowerCase()];
302 }
303
304 await persistAccessConfig(client, guildId, { disabledCommands }, context);
305 return { categoryKey: normalizedKey, displayName: category.displayName };
306}
307
308export function resolveCategoryChoice(client, input) {
309 if (!input) {

Callers 1

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