It is a feature for the kv currency system! When you get a 7 in ur number, you will get +25 coins. If you have the 7 twice in your number, you will get +350 coins. And when u get all three 7 you will get 1k coins!
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
let start = 0;
let result = await lib.utils.kv['@0.1.16'].get({
key: `bal${context.params.event.author.id}`,
defaultValue: start, //Defining the default value of a user's balance as 0.
});
if (
context.params.event.content.toLowerCase() === `${process.env.PREFIX}slots`
) {
let Number0 = [1, 2, 3, 4, 5, 6, 7, 8, 9];
let resultNumber1 = Number0[Math.floor(Math.random() * Number0.length)];
let resultNumber2 = Number0[Math.floor(Math.random() * Number0.length)];
let resultNumber3 = Number0[Math.floor(Math.random() * Number0.length)];
if (resultNumber1 == 7) {
start = start + 25;
}
if (resultNumber2 == 7) {
start = start + 25;
}
if (resultNumber3 == 7) {
start = start + 25;
} // if a 7 is in the number you will get 25 coins!
if (start == 2) {
start = start + 350;
} // if a user gets 2 times the 7 you will get 350 coins!
if (start == 3) {
start = start + 1000;
} // if a user gets a 777 you will get 1000 coins! you can change that if u want!
await lib.discord.channels['@0.1.1'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: '',
tts: false,
embed: {
type: 'rich',
title: `<:ChillZoneCoin:922374806937165834> Slots <:ChillZoneCoin:922374806937165834>`,
description: `Your number is \`${resultNumber1}${resultNumber2}${resultNumber3}\`! You've got \`${start}\`<:ChillZoneCoin:922374806937165834>`,
footer: {
text: `Get 3 times a 7 to get a lot of coins!`,
},
},
});
await lib.utils.kv['@0.1.16'].set({
key: `bal${context.params.event.author.id}`,
value: result + start, //Here we are adding the random money we generated before to the user's current balance.
});
}