converted ShaiBot casino to Nut Economy
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
const {
|
||||
showNutHub
|
||||
} = require("../../utils/nutHub");
|
||||
|
||||
|
||||
module.exports = {
|
||||
name: "nutHubBack",
|
||||
|
||||
async execute(interaction) {
|
||||
return showNutHub(
|
||||
interaction
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
const {
|
||||
showNutBlackjack
|
||||
} = require(
|
||||
"../../utils/nutBlackjack"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"nutHubBlackjack",
|
||||
|
||||
async execute(
|
||||
interaction
|
||||
) {
|
||||
return showNutBlackjack(
|
||||
interaction
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,20 @@
|
||||
const {
|
||||
startNutBlackjack
|
||||
} = require(
|
||||
"../../utils/nutBlackjack"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"nutBlackjackBet10",
|
||||
|
||||
async execute(
|
||||
interaction
|
||||
) {
|
||||
return startNutBlackjack(
|
||||
interaction,
|
||||
10
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,20 @@
|
||||
const {
|
||||
startNutBlackjack
|
||||
} = require(
|
||||
"../../utils/nutBlackjack"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"nutBlackjackBet100",
|
||||
|
||||
async execute(
|
||||
interaction
|
||||
) {
|
||||
return startNutBlackjack(
|
||||
interaction,
|
||||
100
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,20 @@
|
||||
const {
|
||||
startNutBlackjack
|
||||
} = require(
|
||||
"../../utils/nutBlackjack"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"nutBlackjackBet1000",
|
||||
|
||||
async execute(
|
||||
interaction
|
||||
) {
|
||||
return startNutBlackjack(
|
||||
interaction,
|
||||
1000
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,20 @@
|
||||
const {
|
||||
startNutBlackjack
|
||||
} = require(
|
||||
"../../utils/nutBlackjack"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"nutBlackjackBet50",
|
||||
|
||||
async execute(
|
||||
interaction
|
||||
) {
|
||||
return startNutBlackjack(
|
||||
interaction,
|
||||
50
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,20 @@
|
||||
const {
|
||||
startNutBlackjack
|
||||
} = require(
|
||||
"../../utils/nutBlackjack"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"nutBlackjackBet500",
|
||||
|
||||
async execute(
|
||||
interaction
|
||||
) {
|
||||
return startNutBlackjack(
|
||||
interaction,
|
||||
500
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
const {
|
||||
doubleNutBlackjack
|
||||
} = require(
|
||||
"../../utils/nutBlackjack"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"nutBlackjackDouble",
|
||||
|
||||
async execute(
|
||||
interaction
|
||||
) {
|
||||
return doubleNutBlackjack(
|
||||
interaction
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
const {
|
||||
hitNutBlackjack
|
||||
} = require(
|
||||
"../../utils/nutBlackjack"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"nutBlackjackHit",
|
||||
|
||||
async execute(
|
||||
interaction
|
||||
) {
|
||||
return hitNutBlackjack(
|
||||
interaction
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
const {
|
||||
standNutBlackjack
|
||||
} = require(
|
||||
"../../utils/nutBlackjack"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"nutBlackjackStand",
|
||||
|
||||
async execute(
|
||||
interaction
|
||||
) {
|
||||
return standNutBlackjack(
|
||||
interaction
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
const {
|
||||
showNutHeist
|
||||
} = require(
|
||||
"../../utils/nutHeist"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"nutHubHeist",
|
||||
|
||||
async execute(
|
||||
interaction
|
||||
) {
|
||||
return showNutHeist(
|
||||
interaction
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,22 @@
|
||||
// buttons/nutHub/heistHack.js
|
||||
|
||||
const {
|
||||
performNutHeist
|
||||
} = require(
|
||||
"../../utils/nutHeist"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"nutHeistHack",
|
||||
|
||||
async execute(
|
||||
interaction
|
||||
) {
|
||||
return performNutHeist(
|
||||
interaction,
|
||||
"Hack"
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,22 @@
|
||||
// buttons/nutHub/heistSmash.js
|
||||
|
||||
const {
|
||||
performNutHeist
|
||||
} = require(
|
||||
"../../utils/nutHeist"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"nutHeistSmash",
|
||||
|
||||
async execute(
|
||||
interaction
|
||||
) {
|
||||
return performNutHeist(
|
||||
interaction,
|
||||
"Smash"
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,22 @@
|
||||
// buttons/nutHub/heistSneak.js
|
||||
|
||||
const {
|
||||
performNutHeist
|
||||
} = require(
|
||||
"../../utils/nutHeist"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"nutHeistSneak",
|
||||
|
||||
async execute(
|
||||
interaction
|
||||
) {
|
||||
return performNutHeist(
|
||||
interaction,
|
||||
"Sneak"
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,21 @@
|
||||
// buttons/nutHub/roulette.js
|
||||
|
||||
const {
|
||||
showNutRoulette
|
||||
} = require(
|
||||
"../../utils/nutRoulette"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"nutHubRoulette",
|
||||
|
||||
async execute(
|
||||
interaction
|
||||
) {
|
||||
return showNutRoulette(
|
||||
interaction
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
// buttons/nutHub/rouletteBet10.js
|
||||
const {
|
||||
chooseNutRouletteBet
|
||||
} = require("../../utils/nutRoulette");
|
||||
|
||||
module.exports = {
|
||||
name: "nutRouletteBet10",
|
||||
|
||||
async execute(interaction) {
|
||||
return chooseNutRouletteBet(
|
||||
interaction,
|
||||
10
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
// buttons/nutHub/rouletteBet100.js
|
||||
const {
|
||||
chooseNutRouletteBet
|
||||
} = require("../../utils/nutRoulette");
|
||||
|
||||
module.exports = {
|
||||
name: "nutRouletteBet100",
|
||||
|
||||
async execute(interaction) {
|
||||
return chooseNutRouletteBet(
|
||||
interaction,
|
||||
100
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
// buttons/nutHub/rouletteBet1000.js
|
||||
const {
|
||||
chooseNutRouletteBet
|
||||
} = require("../../utils/nutRoulette");
|
||||
|
||||
module.exports = {
|
||||
name: "nutRouletteBet1000",
|
||||
|
||||
async execute(interaction) {
|
||||
return chooseNutRouletteBet(
|
||||
interaction,
|
||||
1000
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
// buttons/nutHub/rouletteBet50.js
|
||||
const {
|
||||
chooseNutRouletteBet
|
||||
} = require("../../utils/nutRoulette");
|
||||
|
||||
module.exports = {
|
||||
name: "nutRouletteBet50",
|
||||
|
||||
async execute(interaction) {
|
||||
return chooseNutRouletteBet(
|
||||
interaction,
|
||||
50
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
// buttons/nutHub/rouletteBet500.js
|
||||
const {
|
||||
chooseNutRouletteBet
|
||||
} = require("../../utils/nutRoulette");
|
||||
|
||||
module.exports = {
|
||||
name: "nutRouletteBet500",
|
||||
|
||||
async execute(interaction) {
|
||||
return chooseNutRouletteBet(
|
||||
interaction,
|
||||
500
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
// buttons/nutHub/rouletteBlack.js
|
||||
const {
|
||||
playNutRoulette
|
||||
} = require("../../utils/nutRoulette");
|
||||
|
||||
module.exports = {
|
||||
name: "nutRouletteBlack",
|
||||
|
||||
async execute(interaction) {
|
||||
return playNutRoulette(
|
||||
interaction,
|
||||
"Black"
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
// buttons/nutHub/rouletteEven.js
|
||||
const {
|
||||
playNutRoulette
|
||||
} = require("../../utils/nutRoulette");
|
||||
|
||||
module.exports = {
|
||||
name: "nutRouletteEven",
|
||||
|
||||
async execute(interaction) {
|
||||
return playNutRoulette(
|
||||
interaction,
|
||||
"Even"
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
// buttons/nutHub/rouletteOdd.js
|
||||
const {
|
||||
playNutRoulette
|
||||
} = require("../../utils/nutRoulette");
|
||||
|
||||
module.exports = {
|
||||
name: "nutRouletteOdd",
|
||||
|
||||
async execute(interaction) {
|
||||
return playNutRoulette(
|
||||
interaction,
|
||||
"Odd"
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
// buttons/nutHub/rouletteRed.js
|
||||
const {
|
||||
playNutRoulette
|
||||
} = require("../../utils/nutRoulette");
|
||||
|
||||
module.exports = {
|
||||
name: "nutRouletteRed",
|
||||
|
||||
async execute(interaction) {
|
||||
return playNutRoulette(
|
||||
interaction,
|
||||
"Red"
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
// buttons/nutHub/rouletteZero.js
|
||||
const {
|
||||
playNutRoulette
|
||||
} = require("../../utils/nutRoulette");
|
||||
|
||||
module.exports = {
|
||||
name: "nutRouletteZero",
|
||||
|
||||
async execute(interaction) {
|
||||
return playNutRoulette(
|
||||
interaction,
|
||||
"Zero"
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
const {
|
||||
playNutSlots
|
||||
} = require(
|
||||
"../../utils/nutSlots"
|
||||
);
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"nutSlotsBet10",
|
||||
|
||||
async execute(
|
||||
interaction
|
||||
) {
|
||||
return playNutSlots(
|
||||
interaction,
|
||||
10
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
const {
|
||||
playNutSlots
|
||||
} = require(
|
||||
"../../utils/nutSlots"
|
||||
);
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"nutSlotsBet100",
|
||||
|
||||
async execute(
|
||||
interaction
|
||||
) {
|
||||
return playNutSlots(
|
||||
interaction,
|
||||
100
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
const {
|
||||
playNutSlots
|
||||
} = require(
|
||||
"../../utils/nutSlots"
|
||||
);
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"nutSlotsBet1000",
|
||||
|
||||
async execute(
|
||||
interaction
|
||||
) {
|
||||
return playNutSlots(
|
||||
interaction,
|
||||
1000
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
const {
|
||||
playNutSlots
|
||||
} = require(
|
||||
"../../utils/nutSlots"
|
||||
);
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"nutSlotsBet50",
|
||||
|
||||
async execute(
|
||||
interaction
|
||||
) {
|
||||
return playNutSlots(
|
||||
interaction,
|
||||
50
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
const {
|
||||
playNutSlots
|
||||
} = require(
|
||||
"../../utils/nutSlots"
|
||||
);
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"nutSlotsBet500",
|
||||
|
||||
async execute(
|
||||
interaction
|
||||
) {
|
||||
return playNutSlots(
|
||||
interaction,
|
||||
500
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,21 @@
|
||||
// buttons/nutHub/slots.js
|
||||
|
||||
const {
|
||||
showNutSlots
|
||||
} = require(
|
||||
"../../utils/nutSlots"
|
||||
);
|
||||
|
||||
|
||||
module.exports = {
|
||||
name:
|
||||
"nutHubSlots",
|
||||
|
||||
async execute(
|
||||
interaction
|
||||
) {
|
||||
return showNutSlots(
|
||||
interaction
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -13,11 +13,11 @@ module.exports = {
|
||||
|
||||
const db = mClient.db(process.env.M_DB)
|
||||
const nutsColl = db.collection('items_nuts')
|
||||
await nutsColl.findOneAndUpdate({ userID: from.id }, { $inc: { nuts: -amount } }, { upsert: true })
|
||||
await nutsColl.findOneAndUpdate({ userID: to.id }, { $inc: { nuts: +amount } }, { upsert: true })
|
||||
await nutsColl.findOneAndUpdate({ userId: from.id }, { $inc: { nuts: -amount } }, { upsert: true })
|
||||
await nutsColl.findOneAndUpdate({ userId: to.id }, { $inc: { nuts: +amount } }, { upsert: true })
|
||||
|
||||
const yourBalance = await nutsColl.findOne({ userID: from.id })
|
||||
const theirBalance = await nutsColl.findOne({ userID: to.id })
|
||||
const yourBalance = await nutsColl.findOne({ userId: from.id })
|
||||
const theirBalance = await nutsColl.findOne({ userId: to.id })
|
||||
const embed = new EmbedBuilder()
|
||||
.setTitle('Gib Nuss!')
|
||||
.setDescription(`Willst du wirklich **${amount}** Nüsse an <@${to.id}> senden?`)
|
||||
|
||||
@@ -12,8 +12,8 @@ module.exports = {
|
||||
const db = mClient.db(process.env.M_DB)
|
||||
const nutsColl = db.collection('items_nuts')
|
||||
|
||||
const yourBalance = await nutsColl.findOne({ userID: from.id })
|
||||
const theirBalance = await nutsColl.findOne({ userID: to.id })
|
||||
const yourBalance = await nutsColl.findOne({ userId: from.id })
|
||||
const theirBalance = await nutsColl.findOne({ userId: to.id })
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
.setTitle('Gib Nuss!')
|
||||
|
||||
@@ -19,7 +19,7 @@ module.exports = {
|
||||
let fields
|
||||
nutsData.forEach((data) => {
|
||||
skip++
|
||||
fields = (fields ? fields : '') + (`${skip}. <@${data.userID}> : ${data.nuts} Nuts\r\n`)
|
||||
fields = (fields ? fields : '') + (`${skip}. <@${data.userId}> : ${data.nuts} Nuts\r\n`)
|
||||
})
|
||||
const embed = new EmbedBuilder()
|
||||
.setTitle('Nuts Leaderboard')
|
||||
|
||||
@@ -17,7 +17,7 @@ module.exports = {
|
||||
let fields
|
||||
nutsData.forEach((data) => {
|
||||
skip++
|
||||
fields = (fields ? fields : '') + (`${skip}. <@${data.userID}> : ${data.nuts} Nuts\r\n`)
|
||||
fields = (fields ? fields : '') + (`${skip}. <@${data.userId}> : ${data.nuts} Nuts\r\n`)
|
||||
})
|
||||
const embed = new EmbedBuilder()
|
||||
.setTitle('Nuts Leaderboard')
|
||||
|
||||
@@ -8,7 +8,7 @@ module.exports = {
|
||||
const db = mClient.db(process.env.M_DB)
|
||||
const nutsColl = db.collection('items_nuts')
|
||||
|
||||
const self = await nutsColl.find({ userID: interaction.user.id }).toArray()
|
||||
const self = await nutsColl.find({ userId: interaction.user.id }).toArray()
|
||||
const all = await nutsColl.find({ nuts: { $gt: 0 } }).sort({ nuts: -1 }).toArray()
|
||||
|
||||
function findIndex(){
|
||||
@@ -16,7 +16,7 @@ module.exports = {
|
||||
for (let i = 0; i < all.length; i++) {
|
||||
index++
|
||||
if (all[i].nuts === self[0].nuts) {
|
||||
return index
|
||||
return index - 1
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@ module.exports = {
|
||||
let fields
|
||||
nutsData.forEach((data) => {
|
||||
skip++
|
||||
fields = (fields ? fields : '') + (`${skip}. <@${data.userID}> : ${data.nuts} Nuts\r\n`)
|
||||
fields = (fields ? fields : '') + (`${skip}. <@${data.userId}> : ${data.nuts} Nuts\r\n`)
|
||||
})
|
||||
const embed = new EmbedBuilder()
|
||||
.setTitle('Nuts Leaderboard')
|
||||
|
||||
Reference in New Issue
Block a user