Compare commits
No commits in common. "c3a197397fc05ecc7a0a3eff0725e063e25f2fa8" and "43119b3422cbc60a375822a5d4e4f1425750fa49" have entirely different histories.
c3a197397f
...
43119b3422
29
README.md
Normal file
29
README.md
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
# Gambling BOT
|
||||||
|
|
||||||
|
Readme in progress...
|
||||||
|
|
||||||
|
## Formules de calcul
|
||||||
|
|
||||||
|
### **Formule de la cote**
|
||||||
|
\[
|
||||||
|
1 + \left( 1 - \frac{\sum \text{vote\_member.bet\_value}}{\text{total.sum}} \right)
|
||||||
|
\]
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### **Formule du gain pour les gagnants**
|
||||||
|
\[
|
||||||
|
\text{nbr\_points} \times \left( \text{cote\_vote} \right)
|
||||||
|
\]
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### **Formule pour les perdants**
|
||||||
|
\[
|
||||||
|
\text{Perte totale, avec un seuil minimal fixé à 50}
|
||||||
|
\]
|
||||||
|
|
||||||
|
|
||||||
|
## TODO
|
||||||
|
|
||||||
|
- [ ] update l'username (quand l'utilisateur en a un nouveau)
|
@ -74,7 +74,7 @@ client.on(Events.InteractionCreate, async interaction => {
|
|||||||
if (!actualOpenedPollCreatedByUser) {
|
if (!actualOpenedPollCreatedByUser) {
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
flags: MessageFlags.Ephemeral,
|
flags: MessageFlags.Ephemeral,
|
||||||
content: `<@${interaction.user.id}>, tu n'as actuellement aucun sondage en cours.`
|
content: `${interaction.user.username}, tu n'as actuellement aucun sondage en cours.`
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -85,7 +85,7 @@ client.on(Events.InteractionCreate, async interaction => {
|
|||||||
if (!winnerVoteId) {
|
if (!winnerVoteId) {
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
flags: MessageFlags.Ephemeral,
|
flags: MessageFlags.Ephemeral,
|
||||||
content: `<@${interaction.user.id}>, L'option **${optionSendedByUser}** n'existe pas.`
|
content: `${interaction.user.username}, L'option **${optionSendedByUser}** n'existe pas.`
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -142,7 +142,7 @@ client.on(Events.InteractionCreate, async interaction => {
|
|||||||
case BET_COMMAND_NAME: {
|
case BET_COMMAND_NAME: {
|
||||||
const amountForNextBet = interaction.options.data[0].value;
|
const amountForNextBet = interaction.options.data[0].value;
|
||||||
const senderPoints = await findUserPoints(interaction.user.id, interaction.guildId);
|
const senderPoints = await findUserPoints(interaction.user.id, interaction.guildId);
|
||||||
if (senderPoints >= amountForNextBet) {
|
if (Number.parseInt(senderPoints.points) >= amountForNextBet) {
|
||||||
await changeNextBetValueForUser(interaction.user.id, interaction.guildId, amountForNextBet);
|
await changeNextBetValueForUser(interaction.user.id, interaction.guildId, amountForNextBet);
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
flags: MessageFlags.Ephemeral,
|
flags: MessageFlags.Ephemeral,
|
||||||
@ -151,7 +151,7 @@ client.on(Events.InteractionCreate, async interaction => {
|
|||||||
} else {
|
} else {
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
flags: MessageFlags.Ephemeral,
|
flags: MessageFlags.Ephemeral,
|
||||||
content: `${interaction.user.id}, solde insuffisant !`
|
content: `${interaction.user.username}, solde insuffisant !`
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user