diff --git a/src/index.js b/src/index.js index 0630bd2..4c99454 100644 --- a/src/index.js +++ b/src/index.js @@ -85,7 +85,7 @@ client.addListener("message", (nick, channel, message, ev) => { const things = args.split(/(,| and )/).map(x => x.trim().replace(",", "").replace(/^(an?|the) /, "")).filter(x => x !== "" && x !== "and") for (let thing of things) { let qty = 1 - const res = /^([-0-9.]+|some|many)\b\s*(.*)$/iu.exec(thing) + const res = /^([-0-9.]+|some|many|half)\b\s*(.*)$/iu.exec(thing) if (res) { const [_, rrqty, rthing] = res thing = rthing @@ -94,6 +94,8 @@ client.addListener("message", (nick, channel, message, ev) => { qty = Math.floor(Math.random() * 17) } else if (rqty === "many") { qty = Math.floor(Math.random() * 2300) + } else if (rqty === "half") { + qty = 0.5 } else { qty = parseFloat(rqty) }