Skip to content

Commit

Permalink
Merge pull request #29 from clienterrverse/es6-rewrite
Browse files Browse the repository at this point in the history
fix bug
  • Loading branch information
GrishMahat authored May 31, 2024
2 parents 8fe084e + 856887c commit 0d9a05d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/commands/developer/servers.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @format */

import { SlashCommandBuilder, EmbedBuilder } from "discord.js";
import paginateEmbeds from '../../utils/buttonPagination.js'; // Correct import statement
import paginateEmbeds from "../../utils/buttonPagination.js"; // Correct import statement

export default {
data: new SlashCommandBuilder()
Expand Down Expand Up @@ -66,7 +66,7 @@ export default {
}

const embeds = [];
const MAX_FIELDS = 9;
const MAX_FIELDS = 8;

for (let i = 0; i < guilds.length; i += MAX_FIELDS) {
const currentGuilds = guilds.slice(i, i + MAX_FIELDS);
Expand Down
7 changes: 7 additions & 0 deletions src/commands/economy/coinflip.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ export default {
.addIntegerOption(option =>
option.setName('gamble_amount')
.setDescription('The amount of clienterr coins you want to gamble.')
.setMinValue(1)
.setMaxValue(30)

.setRequired(true)
)
.toJSON(),
Expand All @@ -36,6 +39,10 @@ export default {
const rollResult = interaction.options.getString('roll_result');
const gambleAmount = interaction.options.getInteger('gamble_amount');
const hourlyCooldown = 60 * 60 * 1000; // 1 hour in milliseconds
if (gambleAmount < 0) {
const embed = new EmbedBuilder().setDescription('The bet amount cannot be negative.');
return interaction.reply({ embeds: [embed], ephemeral: true });
}

// Fetch the user's balance from the database
let userBalance = await Balance.findOne({ userId });
Expand Down
12 changes: 10 additions & 2 deletions src/commands/economy/slots.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ export default {
.setDescription('Play the slot machine.')
.addNumberOption(option =>
option.setName('bet')
.setDescription('Amount to bet (max 10)')
.setRequired(true))
.setDescription('Amount to bet (max 10)')
.setRequired(true)
.setMaxValue(10)
)

.toJSON(),
userPermissions: [],
botPermissions: [],
Expand All @@ -29,6 +32,11 @@ export default {
const rembed = new EmbedBuilder().setDescription('The maximum bet amount is 10 coins.');
return interaction.reply({ embeds: [rembed], ephemeral: true });
}
if (bet < 0) {
const embed = new EmbedBuilder().setDescription('The bet amount cannot be negative.');
return interaction.reply({ embeds: [embed], ephemeral: true });
}


const userBalance = await Balance.findOne({ userId });
if (!userBalance || userBalance.balance < bet) {
Expand Down

0 comments on commit 0d9a05d

Please sign in to comment.