Skip to content

Commit

Permalink
Allow up to Infinity in /add-money
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMonDon committed Jul 22, 2024
1 parent f247ace commit 2575693
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
4 changes: 0 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,6 @@ class Bot extends Client {
client.on(eventName, (...args) => eventModule.run(client, ...args));
}

async unloadEvent(_eventPath, _eventName) {
// Code here
}

/* SETTINGS FUNCTIONS
These functions are used by any and all location in the bot that wants to either
read the current *complete* guild settings (default + overrides, merged) or that
Expand Down
8 changes: 2 additions & 6 deletions slash_commands/Economy/add-money.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,8 @@ exports.run = async (interaction) => {
const currencySymbol = (await db.get(`servers.${interaction.guild.id}.economy.symbol`)) || '$';

if (isNaN(amount)) return interaction.client.util.errorEmbed(interaction, 'Incorrect Usage');
if (amount > 1000000000000)
return interaction.client.util.errorEmbed(
interaction,
`You can't add more than 1 Trillion to a role.`,
'Invalid Amount',
);
if (amount === Infinity)
return interaction.client.util.errorEmbed(interaction, "You can't add Infinity to a member", 'Invalid Amount');

const members = [...role.members.values()];

Expand Down
2 changes: 1 addition & 1 deletion slash_commands/Economy/remove-money.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ exports.run = async (interaction) => {
if (!target.user) return interaction.client.util.errorEmbed(interaction, 'Invalid Member');
if (target.user.bot) return interaction.client.util.errorEmbed(interaction, "You can't remove money from a bot.");

amount = BigInt(parseInt(amount));
amount = BigInt(amount);
if (destination === 'bank') {
const bank = BigInt((await db.get(`servers.${interaction.guild.id}.users.${target.user.id}.economy.bank`)) || 0);
const newAmount = bank - amount;
Expand Down

0 comments on commit 2575693

Please sign in to comment.