diff --git a/commands/Roll.js b/commands/Roll.js index 0fb4f91..eb71483 100644 --- a/commands/Roll.js +++ b/commands/Roll.js @@ -12,11 +12,13 @@ module.exports = { async exec(message, args) { let params = args.join('').split(globals.DiceRegex); if ( params.length >= 2 ) { - const Bonus = params[2] || 0; + const Bonus = parseInt(params[2]) || 0; const numberOfDice = parseInt( params[0] ); const diceValues = parseInt( params[1] ); const result = roll( numberOfDice, diceValues, message.author.tag ); - message.reply(`${findMessage('ROLL')} ${result.dice.join(', ')} (Gesamt: ${result.sum} + ${Bonus} = ${result.sum + Bonus})` ); + let total = (Bonus ? Bonus + result.sum : result.sum) + message.reply(`${findMessage('ROLL')} ${result.dice.join(', ')} `+ + `(Gesamt: ${result.sum}${Bonus ? `+${Bonus}=${total}` : ``})` ); } }, -}; \ No newline at end of file +}; diff --git a/package-lock.json b/package-lock.json index 2d2a9f0..0679166 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "module-alias": "^2.2.2", "nedb": "^1.8.0", "node-fetch": "^2.6.1", - "random": "^3.0.5" + "random": "^3.0.6" }, "devDependencies": { "jest": "^26.6.3" @@ -673,7 +673,6 @@ "jest-resolve": "^26.6.2", "jest-util": "^26.6.2", "jest-worker": "^26.6.2", - "node-notifier": "^8.0.0", "slash": "^3.0.0", "source-map": "^0.6.0", "string-length": "^4.0.1", @@ -1890,8 +1889,7 @@ "esprima": "^4.0.1", "estraverse": "^4.2.0", "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.6.1" + "optionator": "^0.8.1" }, "bin": { "escodegen": "bin/escodegen.js", @@ -3139,7 +3137,6 @@ "@types/node": "*", "anymatch": "^3.0.3", "fb-watchman": "^2.0.0", - "fsevents": "^2.1.2", "graceful-fs": "^4.2.4", "jest-regex-util": "^26.0.0", "jest-serializer": "^26.6.2", @@ -4466,9 +4463,9 @@ } }, "node_modules/random": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/random/-/random-3.0.5.tgz", - "integrity": "sha512-ANuFSZk8lB7kW4JekNHdyTSXH0rwzA+l9oeP646BBdoGXceG5AfdG+S9tbHI1saoOcbbUL3Fs6affbbyCDgobw==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/random/-/random-3.0.6.tgz", + "integrity": "sha512-B53pp/8eFBxULg6sfQgjjmy3vZ2CWVt0Nk4OgkSpvmAf3VXfcEUgGASbNWbXiTiExWe8hCIf5HlddNHzrte9jg==", "dependencies": { "seedrandom": "^3.0.5" }, @@ -9811,9 +9808,9 @@ "dev": true }, "random": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/random/-/random-3.0.5.tgz", - "integrity": "sha512-ANuFSZk8lB7kW4JekNHdyTSXH0rwzA+l9oeP646BBdoGXceG5AfdG+S9tbHI1saoOcbbUL3Fs6affbbyCDgobw==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/random/-/random-3.0.6.tgz", + "integrity": "sha512-B53pp/8eFBxULg6sfQgjjmy3vZ2CWVt0Nk4OgkSpvmAf3VXfcEUgGASbNWbXiTiExWe8hCIf5HlddNHzrte9jg==", "requires": { "seedrandom": "^3.0.5" } diff --git a/package.json b/package.json index 697e146..d7cfe36 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "module-alias": "^2.2.2", "nedb": "^1.8.0", "node-fetch": "^2.6.1", - "random": "^3.0.5" + "random": "^3.0.6" }, "devDependencies": { "jest": "^26.6.3"