Dontopedia

Handle Roll Command Function

From Dontopedia, the open, paraconsistent wiki. (Last updated 2026-05-02.)

Handle Roll Command Function has 62 facts recorded in Dontopedia across 2 references, with 7 live disagreements.

62 facts·50 predicates·2 sources·7 in dispute

Mostly:parses num dice(3), parses num sides(3), validates positive numbers(3)

Maturity scale raw canonical shape-checked rule-derived certified

Inbound mentions (1)

Other subjects in dontopedia point AT this entity as a value. These are inverse relationships — e.g. "X motherOf this subject" — and answer questions the forward facts can't. Grouped by predicate.

providedCodeSnippetProvided Code Snippet(1)

Other facts (62)

The long tail: predicates that appear too rarely to warrant their own section. Filter or scroll to find a specific one. Each row links to its source.

62 facts
PredicateValueRef
Parses Num DiceNum Dice Variable[1]
Parses Num DiceparseInt(match[1], 10)[2]
Parses Num DiceMatch Group 1[2]
Parses Num SidesNum Sides Variable[1]
Parses Num SidesparseInt(match[2], 10)[2]
Parses Num SidesMatch Group 2[2]
Validates Positive NumbersNum Dice Variable[1]
Validates Positive NumbersnumDice <= 0 || numSides <= 0[2]
Validates Positive Numbersnull[2]
Computes Total SumTotal Variable[1]
Computes Total SumReduce Sum[2]
Handles CommandSlash Command Roll[1]
Handles CommandSlash Command Roll[2]
Is Asynctrue[1]
Is Asyncnull[2]
Replies With ResultsRolled ${dice}: [${rolls.join(', ')}] Total: ${total}[1]
Replies With ResultsRolled ${dice}: [${rolls.join(', ')}] Total: ${total}[2]
ExpectsInteraction From Discord Js V13[2]
ExpectsDiscord Js Interaction[2]
Validates Dice Presencetrue[2]
Validates Dice Presencenull[2]
Replies With Positive Error If InvalidNumber of dice and sides must be positive.[1]
Checks Existence ofDice Variable[1]
Compatible WithDiscord Js Library[1]
Expects Library Versiondiscord.js v13+[1]
Extracts Value UsingInteraction Options Getstring[1]
Generates Random RollRolls Array[1]
Initializes ArrayRolls Array[1]
Is Exportedtrue[1]
Is Minimaltrue[1]
Is Ready for Integrationtrue[1]
Loops for Each DieNum Dice Variable[1]
Matches PatternRegex Ndm[1]
Performs Early Return on Errortrue[1]
Purpose Isrolling dice[1]
Replies With Error If MissingPlease provide dice in NdM format, e.g. 2d6.[1]
Replies With Invalid Format Error If No MatchInvalid dice format. Use NdM format, e.g. 2d6.[1]
Assumes Valid InteractionInteraction Object[1]
Sequences Validation Before RollingDice Validation[1]
Sets Reply Ephemeraltrue[1]
Supports Example2d6[1]
Takes ParameterInteraction Object[1]
Uses Math Randomtrue[1]
Replies With Positive ErrorNumber of dice and sides must be positive.[2]
Computes Total With ReduceRolls[2]
Depends onDiscord Js V13[2]
Exported As Modulemodule.exports = { handleRollCommand }[2]
Rolls Each Die WithMath.floor(Math.random() * numSides) + 1[2]
Uses Regex Match/^(\d+)d(\d+)$/i[2]
Generates Rolls ArrayRolls[2]
Gets String OptionDice[2]
Implements Dice LogicStandalone Js[2]
Replies With Error If No DicePlease provide dice in NdM format, e.g. 2d6.[2]
Replies With Invalid Format ErrorInvalid dice format. Use NdM format, e.g. 2d6.[2]
Capable of HandlingValid Dice Input[2]
Matches Against RegexDice Regex[2]
Handles Invalid Formatnull[2]
Replies With Error IfPlease provide dice in NdM format, e.g. 2d6.[2]
Generates Rolls LoopMath Random[2]
GetsDice String[2]
Is Exported As Modulenull[2]
Replies WithRoll Result String[2]

Timeline

Timeline axis is valid_time — when each source says the fact was true in the world, not when Dontopedia learned about it. Retracted rows are kept for provenance; coloured stripes indicate the context kind.

repliesWithPositiveErrorIfInvalidblah/omega/part-557
Number of dice and sides must be positive.
checksExistenceOfblah/omega/part-557
ex:dice-variable
compatibleWithblah/omega/part-557
ex:discord-js-library
computesTotalSumblah/omega/part-557
ex:total-variable
expectsLibraryVersionblah/omega/part-557
discord.js v13+
extractsValueUsingblah/omega/part-557
ex:interaction-options-getstring
generatesRandomRollblah/omega/part-557
ex:rolls-array
handlesCommandblah/omega/part-557
ex:slash-command-roll
initializesArrayblah/omega/part-557
ex:rolls-array
isAsyncblah/omega/part-557
true
isExportedblah/omega/part-557
true
isMinimalblah/omega/part-557
true
isReadyForIntegrationblah/omega/part-557
true
loopsForEachDieblah/omega/part-557
ex:num-dice-variable
matchesPatternblah/omega/part-557
ex:regex-ndm
parsesNumDiceblah/omega/part-557
ex:num-dice-variable
parsesNumSidesblah/omega/part-557
ex:num-sides-variable
performsEarlyReturnOnErrorblah/omega/part-557
true
purposeIsblah/omega/part-557
rolling dice
repliesWithErrorIfMissingblah/omega/part-557
Please provide dice in NdM format, e.g. 2d6.
repliesWithInvalidFormatErrorIfNoMatchblah/omega/part-557
Invalid dice format. Use NdM format, e.g. 2d6.
assumesValidInteractionblah/omega/part-557
ex:interaction-object
repliesWithResultsblah/omega/part-557
Rolled ${dice}: [${rolls.join(', ')}] Total: ${total}
sequencesValidationBeforeRollingblah/omega/part-557
ex:dice-validation
setsReplyEphemeralblah/omega/part-557
true
supportsExampleblah/omega/part-557
2d6
takesParameterblah/omega/part-557
ex:interaction-object
usesMathRandomblah/omega/part-557
true
validatesPositiveNumbersblah/omega/part-557
ex:num-dice-variable
repliesWithPositiveErrorblah/omega/part-556
Number of dice and sides must be positive.
computesTotalWithReduceblah/omega/part-556
ex:rolls
dependsOnblah/omega/part-556
ex:discord-js-v13
expectsblah/omega/part-556
ex:interaction-from-discord-js-v13
parsesNumSidesblah/omega/part-556
parseInt(match[2], 10)
exportedAsModuleblah/omega/part-556
module.exports = { handleRollCommand }
rollsEachDieWithblah/omega/part-556
Math.floor(Math.random() * numSides) + 1
usesRegexMatchblah/omega/part-556
/^(\d+)d(\d+)$/i
generatesRollsArrayblah/omega/part-556
ex:rolls
getsStringOptionblah/omega/part-556
ex:dice
handlesCommandblah/omega/part-556
ex:slash-command-roll
implementsDiceLogicblah/omega/part-556
ex:standalone-js
validatesDicePresenceblah/omega/part-556
true
repliesWithErrorIfNoDiceblah/omega/part-556
Please provide dice in NdM format, e.g. 2d6.
repliesWithInvalidFormatErrorblah/omega/part-556
Invalid dice format. Use NdM format, e.g. 2d6.
validatesPositiveNumbersblah/omega/part-556
numDice <= 0 || numSides <= 0
capableOfHandlingblah/omega/part-556
ex:valid-dice-input
parsesNumDiceblah/omega/part-556
parseInt(match[1], 10)
repliesWithResultsblah/omega/part-556
Rolled ${dice}: [${rolls.join(', ')}] Total: ${total}
matchesAgainstRegexblah/omega/part-556
ex:dice-regex
validatesPositiveNumbersblah/omega/part-556
null
parsesNumDiceblah/omega/part-556
ex:match-group-1
isAsyncblah/omega/part-556
null
handlesInvalidFormatblah/omega/part-556
null
validatesDicePresenceblah/omega/part-556
null
parsesNumSidesblah/omega/part-556
ex:match-group-2
computesTotalSumblah/omega/part-556
ex:reduce-sum
repliesWithErrorIfblah/omega/part-556
Please provide dice in NdM format, e.g. 2d6.
generatesRollsLoopblah/omega/part-556
ex:math-random
getsblah/omega/part-556
ex:dice-string
expectsblah/omega/part-556
ex:discord-js-interaction
isExportedAsModuleblah/omega/part-556
null
repliesWithblah/omega/part-556
ex:roll-result-string

References (2)

2 references
  1. [1]Part 55729 facts
    ctx:discord/blah/omega/part-557
  2. [2]Part 55633 facts
    ctx:discord/blah/omega/part-556

See also

Keep researching

Missing something or suspicious of what's here? Kick off a research session — a Claude agent will investigate, cite its sources, and file new facts into a dedicated context you can review before accepting into the shared view.