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

Function activateCountingGame

src/services/countingGameService.js:281–295  ·  view source on GitHub ↗
(client, guildId, channelId, system = 'decimal')

Source from the content-addressed store, hash-verified

279}
280
281export async function activateCountingGame(client, guildId, channelId, system = 'decimal') {
282 const normalizedSystem = COUNTING_SYSTEMS[system] ? system : 'decimal';
283 const config = normalizeCountingGame({
284 enabled: true,
285 channelId,
286 system: normalizedSystem,
287 nextNumber: 1,
288 lastUserId: null,
289 currentStreak: 0,
290 bestStreak: 0,
291 leaderboard: {},
292 });
293
294 return saveCountingGameConfig(client, guildId, config);
295}
296
297export function buildCountingLeaderboard(config, guild) {
298 const entries = Object.entries(config.leaderboard || {});

Callers 1

executeFunction · 0.90

Calls 2

normalizeCountingGameFunction · 0.85
saveCountingGameConfigFunction · 0.85

Tested by

no test coverage detected