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

Method clearWarnings

src/services/warningService.js:93–107  ·  view source on GitHub ↗
(guildId, userId)

Source from the content-addressed store, hash-verified

91 }
92
93 static async clearWarnings(guildId, userId) {
94 try {
95 const key = `moderation:warnings:${guildId}:${userId}`;
96 const warnings = await getFromDb(key, []);
97 const count = warnings.length;
98
99 await setInDb(key, []);
100
101 logger.info(`Warnings cleared for ${userId} in ${guildId} (${count} removed)`);
102 return { success: true, count };
103 } catch (error) {
104 logger.error('Error clearing warnings:', error);
105 return { success: false, error: error.message };
106 }
107 }
108
109 static async getGuildWarnings(guildId, filters = {}) {
110 try {

Callers 1

Calls 2

getFromDbFunction · 0.90
setInDbFunction · 0.90

Tested by

no test coverage detected