MCPcopy Create free account
hub / github.com/codebymitch/TitanBot / isValidCountingMessage

Function isValidCountingMessage

src/services/countingGameService.js:265–279  ·  view source on GitHub ↗
(content, config)

Source from the content-addressed store, hash-verified

263}
264
265export function isValidCountingMessage(content, config) {
266 const trimmed = content.trim();
267 const system = COUNTING_SYSTEMS[config.system] ? config.system : 'decimal';
268 const current = COUNTING_SYSTEMS[system];
269 if (system === 'math') {
270 const parsedValue = current.parse(trimmed);
271 return parsedValue === config.nextNumber;
272 }
273
274 const expected = current.toString(config.nextNumber || 1);
275 if (system === 'alphabet' || system === 'roman') {
276 return trimmed.toUpperCase() === expected.toUpperCase();
277 }
278 return trimmed === expected;
279}
280
281export async function activateCountingGame(client, guildId, channelId, system = 'decimal') {
282 const normalizedSystem = COUNTING_SYSTEMS[system] ? system : 'decimal';

Callers 1

handleCountingGameFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected