!!DEPRECATED!!
Please use https://www.npmjs.com/package/bcdice
BCDice for JavaScript (Browser/Node.js). Transpiled by Opal.
- Node.js (CommonJS): examples/node
- Browser with Webpack (slower, simple): examples/browser
- Webpack Dynamic Import (faster, recommended): examples/webpak-import
-
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());
- Open Issue or Pull Request
- Supported Language
- English
- Japanese(日本語)
MIT License
- BCDice: Modified BSD license