!!DEPRECATED!!
Please use https://www.npmjs.com/package/bcdice
BCDice for JavaScript (Browser/Node.js). Transpiled by Opal.
Install
$ npm install --save bcdice-js
Import
import BCDice from 'bcdice-js'; // ES Modules
// or
const BCDice = require('bcdice-js').BCDice; // CommonJS
Preload dicebots (Only on the browser!!)
import 'bcdice-js/lib/preload-dicebots';
// or
require('bcdice-js/lib/preload-dicebots');
Create BCDice instance
const bcdice = new BCDice();
Set dicebot
bcdice.setGameByTitle('SwordWorld2_0'); // Default: 'DiceBot'
Set message and execute
bcdice.setMessage('2d');
console.log(bcdice.dice_command());
MIT License