@dicelette/core
Advanced tools
Comparing version 1.9.1 to 1.10.0
@@ -336,3 +336,11 @@ "use strict"; | ||
const split = dice.split(";"); | ||
const diceResult = roll(split[0]); | ||
let diceMain = split[0]; | ||
const toHideRegex = /\((?<dice>.*)\)/; | ||
const toHide = diceMain.match(toHideRegex); | ||
let hidden = false; | ||
if (toHide?.groups?.dice) { | ||
diceMain = toHide.groups.dice; | ||
hidden = true; | ||
} | ||
const diceResult = roll(diceMain); | ||
if (!diceResult || !diceResult.total) return void 0; | ||
@@ -379,4 +387,6 @@ results.push(`${diceResult.result}`); | ||
} | ||
if (hidden) | ||
results.shift(); | ||
return { | ||
dice: split[0], | ||
dice: diceMain, | ||
result: results.join(";"), | ||
@@ -383,0 +393,0 @@ comment: comments, |
{ | ||
"name": "@dicelette/core", | ||
"version": "1.9.1", | ||
"version": "1.10.0", | ||
"description": "Core library for the Dicelette Discord bot", | ||
@@ -46,2 +46,6 @@ "repository": { | ||
}, | ||
"trustedDependencies": [ | ||
"@biomejs/biome", | ||
"esbuild" | ||
], | ||
"scripts": { | ||
@@ -48,0 +52,0 @@ "test": "vitest", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
210671
1828