Compare commits
No commits in common. "43119b3422cbc60a375822a5d4e4f1425750fa49" and "c3a197397fc05ecc7a0a3eff0725e063e25f2fa8" have entirely different histories.
43119b3422
...
c3a197397f
29
README.md
29
README.md
@ -1,29 +0,0 @@
|
|||||||
# 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.username}, tu n'as actuellement aucun sondage en cours.`
|
content: `<@${interaction.user.id}>, 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.username}, L'option **${optionSendedByUser}** n'existe pas.`
|
content: `<@${interaction.user.id}>, 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 (Number.parseInt(senderPoints.points) >= amountForNextBet) {
|
if (senderPoints >= 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.username}, solde insuffisant !`
|
content: `${interaction.user.id}, solde insuffisant !`
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user