Cleanup
This commit is contained in:
parent
ea6997ac48
commit
08a387b1a9
@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
A discord bot for metaphorically "rolling dice"/generating random values. Made for use with Weaverdice systems.
|
A discord bot for metaphorically "rolling dice"/generating random values. Made for use with Weaverdice systems.
|
||||||
|
|
||||||
|
Icon by [Zauromoun]()
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
- Cool ez syntax blatantly copied from [rollem.rocks](https://rollem.rocks):
|
- Cool ez syntax blatantly copied from [rollem.rocks](https://rollem.rocks):
|
||||||
> 2d6 - 1
|
> 2d6 - 1
|
||||||
|
32
src/index.js
32
src/index.js
@ -60,26 +60,24 @@ const handleMessage = (message, respond) => {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
if(dice.operation) {
|
switch(dice.operation) {
|
||||||
switch(dice.operation) {
|
case '+':
|
||||||
case '+':
|
result += dice.modifier
|
||||||
result += dice.modifier
|
break
|
||||||
break
|
|
||||||
|
|
||||||
case '-':
|
case '-':
|
||||||
result -= dice.modifier
|
result -= dice.modifier
|
||||||
break
|
break
|
||||||
|
|
||||||
case 'x':
|
case 'x':
|
||||||
operationSymbol = '*'
|
operationSymbol = '*'
|
||||||
case '*':
|
case '*':
|
||||||
result = result * dice.modifier
|
result = result * dice.modifier
|
||||||
break
|
break
|
||||||
|
|
||||||
case '/':
|
case '/':
|
||||||
result = result / dice.modifier
|
result = result / dice.modifier
|
||||||
break
|
break
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(dice.description)
|
if(dice.description)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user