I remember around covid time I wanted to make a dnd thing and I don't remember if this was online or only a github repo but I remember using a sick ass dice rolling engine like this.
I don't remember anything about where it is anymore.... Oh shit. I found it.. And this was before AI bro!

GitHub
dnd-game/src/components/dice-board at master · dipunm/dnd-game
Personal project, a socket based application to facilitate a game of Dungeons and Dragons - dipunm/dnd-game