exports.run = async (client, message, [credit, bet]) => {
    const sqlite3 = require("sqlite3").verbose();
    let db = new sqlite3.Database("./bwd/data/score.sqlite");

    db.get(`SELECT * FROM scores WHERE userId = "${message.author.id}"`, [], (err, row) => {
        if (err) { return console.log(err); }
        if (!row) { return message.reply("You haven't signed up and received your credits yet! D: Use `m~daily` (Using default prefix) to earn your first amount of credits."); } 
        if (row.credits < credit) { return message.reply("You don't have that many credits, baka!"); }
        if (!credit || credit < 1) { return message.reply("You need to bet some credits to play!"); }
        else {
            die1 = Math.floor(Math.random() * (Math.floor(6) - Math.ceil(1) + 1)) + Math.ceil(1);
            die2 = Math.floor(Math.random() * (Math.floor(6) - Math.ceil(1) + 1)) + Math.ceil(1);
            die3 = Math.floor(Math.random() * (Math.floor(6) - Math.ceil(1) + 1)) + Math.ceil(1);
            die4 = Math.floor(Math.random() * (Math.floor(6) - Math.ceil(1) + 1)) + Math.ceil(1);
            die5 = Math.floor(Math.random() * (Math.floor(6) - Math.ceil(1) + 1)) + Math.ceil(1);
            die6 = Math.floor(Math.random() * (Math.floor(6) - Math.ceil(1) + 1)) + Math.ceil(1);

            sum = die1 + die2 + die3 + die4 + die5 + die6;

            if (sum%2 == 0 && bet === "even") {
                credit = (row.credits + (credit*1.5)).toFixed(0);
                db.run(`UPDATE scores SET credits = ${credit} WHERE userId = ${message.author.id}`);
                return message.reply(`Sum: ${sum} Your Guess: ${bet} You have won ${credit - row.credits} credits!`);
            } else if (sum%2 !== 0 && bet === "odd") {
                credit = (row.credits + (credit*1.5)).toFixed(0);
                db.run(`UPDATE scores SET credits = ${credit} WHERE userId = ${message.author.id}`);
                return message.reply(`Sum: ${sum} Your Guess: ${bet} You have won ${credit - row.credits} credits!`);
            } else {
                afterMath = (row.credits - credit).toFixed(0);
                db.run(`UPDATE scores SET credits = ${afterMath} WHERE userId = ${message.author.id}`);
                return message.reply(`Sum: ${sum} Your Guess: ${bet} You have lost ${credit} credits.`);
            }
        }
    });
    db.close();
};

exports.conf = {
    enabled: true,
    runIn: ["text"],
    aliases: ["chō-han", "chōhan", "chou-han"],
    permLevel: 0,
    botPerms: [],
    requiredFuncs: [],
};
  
exports.help = {
    name: "chouhan",
    description: "Bet your credits on if the sum of six dice are even or odd.",
    usage: "[credits:int] <even|odd>",
    usageDelim: " ",
    extendedHelp: "A Simple Japanese dice game. Six dice are rolled and the results kept secret. Players bet on whether the sum on the dice is odd or even.",
};

@@ -718,583 +718,216 @@
     
-die1 = Math.floor(Math.random() * (Math.floor(6) - Math.ceil(1) + 1)) + Math.ceil(1);%0A            die2 = Math.floor(Math.random() * (Math.floor(6) - Math.ceil(1) + 1)) + Math.ceil(1);%0A            die3 = Math.floor(Math.random() * (Math.floor(6) - Math.ceil(1) + 1)) + Math.ceil(1);%0A            die4 = Math.floor(Math.random() * (Math.floor(6) - Math.ceil(1) + 1)) + Math.ceil(1);%0A            die5 = Math.floor(Math.random() * (Math.floor(6) - Math.ceil(1) + 1)) + Math.ceil(1);%0A            die6 = Math.floor(Math.random() * (Math.floor(6) - Math.ceil(1) + 1)) + Math.ceil(1);
+var z; let rolls = %5B%5D;%0A            for (z = 0; z %3C 6; z++) %7B%0A                var x = Math.floor(Math.random() * (Math.floor(6) - Math.ceil(1) + 1)) + Math.ceil(1);%0A                rolls.push(x);%0A            %7D
 %0A%0A  
@@ -940,53 +940,81 @@
     
+var 
 sum = 
-die1 + die2 + die3 + die4 + die5 + die6
+rolls%5B0%5D + rolls%5B1%5D + rolls%5B2%5D + rolls%5B3%5D + rolls%5B4%5D + rolls%5B5%5D
 ;%0A%0A 
@@ -1023,24 +1023,25 @@
          if 
+(
 (sum%252 == 0 
@@ -1037,16 +1037,17 @@
 sum%252 ==
+=
  0 && be
@@ -1064,316 +1064,10 @@
 n%22) 
-%7B%0A                credit = (row.credits + (credit*1.5)).toFixed(0);%0A                db.run(%60UPDATE scores SET credits = $%7Bcredit%7D WHERE userId = $%7Bmessage.author.id%7D%60);%0A                return message.reply(%60Sum: $%7Bsum%7D Your Guess: $%7Bbet%7D You have won $%7Bcredit - row.credits%7D credits!%60);%0A            %7D else if
+%7C%7C
  (su
@@ -1093,16 +1093,17 @@
 = %22odd%22)
+)
  %7B%0A     
@@ -1126,23 +1126,14 @@
 t = 
-(row.credits + 
+Number
 (cre
@@ -1140,17 +1140,16 @@
 dit*1.5)
-)
 .toFixed
@@ -1207,16 +1207,40 @@
 its = $%7B
+parseInt(row.credits) + 
 credit%7D 
@@ -1372,22 +1372,8 @@
 edit
- - row.credits
 %7D cr
@@ -1407,71 +1407,8 @@
 e %7B%0A
-                afterMath = (row.credits - credit).toFixed(0);%0A
     
@@ -1461,17 +1461,38 @@
 = $%7B
-afterMath
+parseInt(row.credits) - credit
 %7D WH

Update chouhan.js