diff --git a/src/commands/roll.ts b/src/commands/roll.ts index 7f3c526..90fd372 100644 --- a/src/commands/roll.ts +++ b/src/commands/roll.ts @@ -86,9 +86,8 @@ const getRoute = async ( export const roll = async (text: string) => { try { - const parts = text.trim().split(" "); - - const result = await getRoute(parseVal(parts[1]), parseVal(parts[2])); + const parts = text.match(/^\/roll\s?(\d+)?[-\s]?(\d+)?$/); + const result = await getRoute(parseVal(parts?.[1]), parseVal(parts?.[2])); if (!result || !result?.id) { return say(failureMessages);