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

Function recordCorrectCount

src/services/countingGameService.js:232–247  ·  view source on GitHub ↗
(client, guildId, userId)

Source from the content-addressed store, hash-verified

230}
231
232export async function recordCorrectCount(client, guildId, userId) {
233 const config = await getCountingGameConfig(client, guildId);
234 const leaderboard = { ...config.leaderboard };
235 leaderboard[userId] = (leaderboard[userId] || 0) + 1;
236
237 const updatedConfig = {
238 ...config,
239 leaderboard,
240 lastUserId: userId,
241 currentStreak: (config.currentStreak || 0) + 1,
242 bestStreak: Math.max(config.bestStreak || 0, (config.currentStreak || 0) + 1),
243 nextNumber: (config.nextNumber || 1) + 1,
244 };
245
246 return saveCountingGameConfig(client, guildId, updatedConfig);
247}
248
249export function getCountingSystemChoices() {
250 return Object.entries(COUNTING_SYSTEMS).map(([value, system]) => ({

Callers 1

handleCountingGameFunction · 0.90

Calls 2

getCountingGameConfigFunction · 0.85
saveCountingGameConfigFunction · 0.85

Tested by

no test coverage detected