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

Method getWarnings

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

Source from the content-addressed store, hash-verified

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);

Callers 3

getWarningCountMethod · 0.95
executeFunction · 0.80

Calls 1

getFromDbFunction · 0.90

Tested by

no test coverage detected