(client, guildId, channelId, system = 'decimal')
| 279 | } |
| 280 | |
| 281 | export 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 | |
| 297 | export function buildCountingLeaderboard(config, guild) { |
| 298 | const entries = Object.entries(config.leaderboard || {}); |
no test coverage detected