roll: lua brained
This commit is contained in:
parent
7e735b93e5
commit
fdff86e318
1 changed files with 5 additions and 5 deletions
|
@ -11,11 +11,11 @@ roll.callback = function (msg, line, [sides], {advantage, disadvantage}) {
|
|||
let num = 1;
|
||||
if (sides.indexOf("d") > -1) {
|
||||
const split = sides.split("d");
|
||||
if (split[2] != null) {
|
||||
num = split[1];
|
||||
sides = split[2];
|
||||
} else {
|
||||
if (split[1] != null) {
|
||||
num = split[0];
|
||||
sides = split[1];
|
||||
} else {
|
||||
sides = split[0];
|
||||
}
|
||||
}
|
||||
num = Number(num);
|
||||
|
@ -71,7 +71,7 @@ const rollInteraction = new InteractionCommand("roll");
|
|||
rollInteraction.helpText = "Roll a dice";
|
||||
rollInteraction.options.sides = {
|
||||
name: "sides",
|
||||
type: ApplicationCommandOptionTypes.NUMBER,
|
||||
type: ApplicationCommandOptionTypes.STRING,
|
||||
description: "How many sides to pick from (use #d# to roll multiple dice)",
|
||||
required: false,
|
||||
default: 6,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue