MCPcopy
hub / github.com/codebymitch/TitanBot / isCommandEnabled

Function isCommandEnabled

src/services/commandAccessService.js:144–154  ·  view source on GitHub ↗
(client, guildId, commandName, category = null)

Source from the content-addressed store, hash-verified

142}
143
144export async function isCommandEnabled(client, guildId, commandName, category = null) {
145 const config = await getGuildConfig(client, guildId);
146 let resolvedCategory = category;
147
148 if (!resolvedCategory) {
149 const command = client.commands.get(commandName);
150 resolvedCategory = command?.category || 'Core';
151 }
152
153 return isCommandEnabledInConfig(config, commandName, resolvedCategory);
154}
155
156export function getCommandAccessSnapshot(client, config) {
157 const registry = buildCommandRegistry(client);

Callers 2

handlePrefixCommandFunction · 0.90
executeFunction · 0.90

Calls 3

getGuildConfigFunction · 0.90
isCommandEnabledInConfigFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected