(guildId, userId)
| 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 { |
no test coverage detected