(guildId, userId)
| 51 | } |
| 52 | |
| 53 | static async getWarnings(guildId, userId) { |
| 54 | try { |
| 55 | const key = `moderation:warnings:${guildId}:${userId}`; |
| 56 | const warnings = await getFromDb(key, []); |
| 57 | |
| 58 | return Array.isArray(warnings) |
| 59 | ? warnings.filter(w => w && w.status !== 'deleted') |
| 60 | : []; |
| 61 | } catch (error) { |
| 62 | logger.error('Error fetching warnings:', error); |
| 63 | return []; |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | static async getWarningCount(guildId, userId) { |
| 68 | const warnings = await this.getWarnings(guildId, userId); |
no test coverage detected