MCPcopy Create free account
hub / github.com/codebymitch/TitanBot / updateIgnoreList

Function updateIgnoreList

src/services/loggingService.js:436–461  ·  view source on GitHub ↗
(client, guildId, { action, type, id })

Source from the content-addressed store, hash-verified

434}
435
436export async function updateIgnoreList(client, guildId, { action, type, id }) {
437 try {
438 const config = await getGuildConfig(client, guildId);
439 const ignore = { ...getIgnoreList(config) };
440 const listKey = type === 'user' ? 'users' : 'channels';
441 const current = [...(ignore[listKey] || [])];
442
443 if (action === 'add' && !current.includes(id)) {
444 current.push(id);
445 } else if (action === 'remove') {
446 const index = current.indexOf(id);
447 if (index !== -1) {
448 current.splice(index, 1);
449 }
450 }
451
452 ignore[listKey] = current;
453
454 const logging = { ...config.logging, ignore };
455 await updateGuildConfig(client, guildId, { logging });
456 return true;
457 } catch (error) {
458 logger.error('Error updating ignore list:', error);
459 return false;
460 }
461}
462
463export function resolveApplicationLogChannel(config, roleSettings = {}, appSettings = {}) {
464 return roleSettings.logChannelId

Callers 2

handleAddFilterModalFunction · 0.90
handleRemoveFilterModalFunction · 0.90

Calls 2

getGuildConfigFunction · 0.90
getIgnoreListFunction · 0.85

Tested by

no test coverage detected