Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update dependencies #155

Merged
merged 2 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5,181 changes: 2,197 additions & 2,984 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "https://falbot.netlify.app/",
"main": "./src/index.js",
"scripts": {
"start": "node ./src/index",
"start": "node --env-file=.env ./src/index",
"prepare": "husky install"
},
"lint-staged": {
Expand All @@ -16,18 +16,18 @@
"author": "Falcão",
"license": "GNU 3.0",
"dependencies": {
"discord.js": "^14.9.0",
"dotenv": "^16.0.1",
"discord.js": "^14.15.3",
"falgames": "^1.2.0",
"mongoose": "^6.8.0",
"mongoose": "^6.13.0",
"numerize": "^1.0.0",
"simply-blackjack": "^1.0.3"
},
"devDependencies": {
"eslint": "^8.45.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^8.10.0",
"eslint-plugin-prettier": "^5.1.3",
"husky": "^8.0.0",
"lint-staged": "^13.2.3",
"prettier": "^3.0.0"
"lint-staged": "^13.3.0",
"prettier": "^3.3.2"
}
}
1 change: 0 additions & 1 deletion src/bot.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const { randint, format } = require('./utils/functions.js');
const { Client, GatewayIntentBits, Collection, EmbedBuilder } = require('discord.js');
const path = require('path');
require('dotenv').config();
const { loadEvents } = require('./handlers/eventHandler.js');
const { loadCommands } = require('./handlers/commandHandler.js');

Expand Down
7 changes: 4 additions & 3 deletions src/commands/economy/bank.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { SlashCommandBuilder } = require('discord.js');
const { specialArg, format } = require('../../utils/functions.js');
const { format } = require('../../utils/functions.js');
const { numerize } = require('numerize');

module.exports = {
data: new SlashCommandBuilder()
Expand Down Expand Up @@ -105,7 +106,7 @@ module.exports = {
await instance.editReply(interaction, { embeds: [embed] });
} else if (subcommand === 'deposit') {
try {
var quantity = specialArg(falcoins, player.falcoins);
var quantity = numerize(falcoins, player.falcoins);
} catch {
await instance.editReply(interaction, {
content: instance.getMessage(interaction, 'BAD_VALUE', {
Expand Down Expand Up @@ -158,7 +159,7 @@ module.exports = {
}
} else if (subcommand === 'withdraw') {
try {
var quantity = specialArg(falcoins, player.bank);
var quantity = numerize(falcoins, player.bank);
} catch {
await instance.editReply(interaction, {
content: instance.getMessage(interaction, 'BAD_VALUE', {
Expand Down
5 changes: 3 additions & 2 deletions src/commands/economy/blackjack.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const { specialArg, format } = require('../../utils/functions.js');
const { format } = require('../../utils/functions.js');
const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder } = require('discord.js');
const Blackjack = require('simply-blackjack');
const User = require('../../schemas/user-schema.js');
const { numerize } = require('numerize');

module.exports = {
data: new SlashCommandBuilder()
Expand Down Expand Up @@ -34,7 +35,7 @@ module.exports = {
var bet = interaction.options.getString('falcoins');
const { falcoins } = await User.findByIdAndUpdate(user.id, {}, { select: 'falcoins', upsert: true, new: true });
try {
bet = await specialArg(bet, falcoins);
bet = await numerize(bet, falcoins);
} catch {
await instance.editReply(interaction, {
content: instance.getMessage(interaction, 'BAD_VALUE', {
Expand Down
5 changes: 3 additions & 2 deletions src/commands/economy/crash.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { specialArg, randint, format } = require('../../utils/functions.js');
const { randint, format } = require('../../utils/functions.js');
const { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder } = require('discord.js');
const { numerize } = require('numerize');

module.exports = {
data: new SlashCommandBuilder()
Expand Down Expand Up @@ -32,7 +33,7 @@ module.exports = {
const falcoins = interaction.options.getString('falcoins');
const player = await database.player.findOne(member.id);
try {
var bet = specialArg(falcoins, player.falcoins);
var bet = numerize(falcoins, player.falcoins);
} catch {
await instance.editReply(interaction, {
content: instance.getMessage(interaction, 'BAD_VALUE', {
Expand Down
5 changes: 3 additions & 2 deletions src/commands/economy/donate.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { specialArg, format } = require('../../utils/functions.js');
const { format } = require('../../utils/functions.js');
const { SlashCommandBuilder } = require('discord.js');
const { numerize } = require('numerize');

module.exports = {
data: new SlashCommandBuilder()
Expand Down Expand Up @@ -46,7 +47,7 @@ module.exports = {
const author = await database.player.findOne(user.id);
const receiver = await database.player.findOne(target.id);
try {
var quantity = specialArg(falcoins, author.falcoins);
var quantity = numerize(falcoins, author.falcoins);
} catch {
await instance.editReply(interaction, {
content: instance.getMessage(interaction, 'BAD_VALUE', {
Expand Down
12 changes: 7 additions & 5 deletions src/commands/economy/exchange.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const { SlashCommandBuilder } = require('discord.js');
const { format, buttons, getItem, specialArg } = require('../../utils/functions.js');
const { format, buttons, getItem } = require('../../utils/functions.js');
const { numerize } = require('numerize');

module.exports = {
data: new SlashCommandBuilder()
.setName('exchange')
Expand Down Expand Up @@ -88,7 +90,7 @@ module.exports = {
//separate the falcoins from the items
for (var i = 0; i < offerItems.length; i++) {
if (offerItems[i].includes('falcoins')) {
offerFalcoins = specialArg(offerItems[i].split(' ')[0], userFile.falcoins);
offerFalcoins = numerize(offerItems[i].split(' ')[0], userFile.falcoins);
} else {
offerItems[i] = offerItems[i].trim();
var itemName = getItem(offerItems[i].split(' ').slice(1).join(' '));
Expand All @@ -102,7 +104,7 @@ module.exports = {
}
try {
offerItemsNames.push(itemName);
offerItemsAmount.push(specialArg(offerItems[i].split(' ')[0], userFile.inventory.get(itemName)));
offerItemsAmount.push(numerize(offerItems[i].split(' ')[0], userFile.inventory.get(itemName)));
} catch {
await instance.editReply(interaction, {
content: instance.getMessage(interaction, 'BAD_VALUE', {
Expand All @@ -117,7 +119,7 @@ module.exports = {
//separate the falcoins from the items
for (var i = 0; i < receiveItems.length; i++) {
if (receiveItems[i].includes('falcoins')) {
receiveFalcoins = specialArg(receiveItems[i].split(' ')[0], recipientFile.falcoins);
receiveFalcoins = numerize(receiveItems[i].split(' ')[0], recipientFile.falcoins);
} else {
receiveItems[i] = receiveItems[i].trim();
var itemName = getItem(receiveItems[i].split(' ').slice(1).join(' '));
Expand All @@ -131,7 +133,7 @@ module.exports = {
}
try {
receiveItemsNames.push(itemName);
receiveItemsAmount.push(specialArg(receiveItems[i].split(' ')[0], recipientFile.inventory.get(itemName)));
receiveItemsAmount.push(numerize(receiveItems[i].split(' ')[0], recipientFile.inventory.get(itemName)));
} catch {
await instance.editReply(interaction, {
content: instance.getMessage(interaction, 'BAD_VALUE', {
Expand Down
5 changes: 3 additions & 2 deletions src/commands/economy/fight.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { SlashCommandBuilder } = require('discord.js');
const { specialArg, format, randint, buttons, pick } = require('../../utils/functions.js');
const { format, randint, buttons, pick } = require('../../utils/functions.js');
const { numerize } = require('numerize');

module.exports = {
data: new SlashCommandBuilder()
Expand Down Expand Up @@ -54,7 +55,7 @@ module.exports = {
}

try {
var bet = await specialArg(falcoins, author.falcoins);
var bet = await numerize(falcoins, author.falcoins);
} catch {
instance.editReply(interaction, {
content: instance.getMessage(interaction, 'BAD_VALUE', {
Expand Down
5 changes: 3 additions & 2 deletions src/commands/economy/horse.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { SlashCommandBuilder } = require('discord.js');
const { specialArg, randint, format } = require('../../utils/functions.js');
const { randint, format } = require('../../utils/functions.js');
const { numerize } = require('numerize');

module.exports = {
data: new SlashCommandBuilder()
Expand Down Expand Up @@ -54,7 +55,7 @@ module.exports = {
const falcoins = interaction.options.getString('falcoins');
const player = await database.player.findOne(user.id);
try {
var bet = await specialArg(falcoins, player.falcoins);
var bet = await numerize(falcoins, player.falcoins);
} catch {
await instance.editReply(interaction, {
content: instance.getMessage(interaction, 'BAD_VALUE', {
Expand Down
5 changes: 3 additions & 2 deletions src/commands/economy/horseduel.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { SlashCommandBuilder, time } = require('discord.js');
const { specialArg, randint, format, buttons } = require('../../utils/functions.js');
const { randint, format, buttons } = require('../../utils/functions.js');
const { numerize } = require('numerize');

module.exports = {
data: new SlashCommandBuilder()
Expand Down Expand Up @@ -34,7 +35,7 @@ module.exports = {
const falcoins = interaction.options.getString('falcoins');
const player = await database.player.findOne(user.id);
try {
var bet = await specialArg(falcoins, player.falcoins);
var bet = await numerize(falcoins, player.falcoins);
} catch {
await instance.editReply(interaction, {
content: instance.getMessage(interaction, 'BAD_VALUE', {
Expand Down
5 changes: 3 additions & 2 deletions src/commands/economy/inventory.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { format, paginate, getItem, buttons, isEquipped, specialArg } = require('../../utils/functions.js');
const { format, paginate, getItem, buttons, isEquipped } = require('../../utils/functions.js');
const { ButtonBuilder, SlashCommandBuilder, StringSelectMenuBuilder, ActionRowBuilder } = require('discord.js');
const { numerize } = require('numerize');

module.exports = {
data: new SlashCommandBuilder()
Expand Down Expand Up @@ -466,7 +467,7 @@ module.exports = {
try {
var amount = Math.min(
player.inventory.get(itemKey),
specialArg(interaction.options.getString('amount'), player.inventory.get(itemKey))
numerize(interaction.options.getString('amount'), player.inventory.get(itemKey))
);
} catch {
await instance.editReply(interaction, {
Expand Down
5 changes: 3 additions & 2 deletions src/commands/economy/lottery.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { msToTime, format, specialArg } = require('../../utils/functions.js');
const { msToTime, format } = require('../../utils/functions.js');
const { SlashCommandBuilder } = require('discord.js');
const { numerize } = require('numerize');

module.exports = {
data: new SlashCommandBuilder()
Expand Down Expand Up @@ -69,7 +70,7 @@ module.exports = {
const player = await database.player.findOne(user.id);
if (type === 'buy') {
try {
var amount = specialArg(interaction.options.getString('amount'), parseInt(player.falcoins / 500));
var amount = numerize(interaction.options.getString('amount'), parseInt(player.falcoins / 500));
} catch {
await instance.editReply(interaction, {
content: instance.getMessage(interaction, 'BAD_VALUE', {
Expand Down
13 changes: 7 additions & 6 deletions src/commands/economy/market.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { format, paginate, getItem, specialArg } = require('../../utils/functions.js');
const { format, paginate, getItem } = require('../../utils/functions.js');
const { ButtonBuilder, SlashCommandBuilder, StringSelectMenuBuilder } = require('discord.js');
const { numerize } = require('numerize');

module.exports = {
developer: false,
Expand Down Expand Up @@ -438,7 +439,7 @@ module.exports = {
}

try {
var amountArgument = await specialArg(interaction.options.getString('amount'), Number.MAX_SAFE_INTEGER);
var amountArgument = await numerize(interaction.options.getString('amount'), Number.MAX_SAFE_INTEGER);
var amount = amountArgument;
} catch {
await instance.editReply(interaction, {
Expand Down Expand Up @@ -510,7 +511,7 @@ module.exports = {
const userFile = await database.player.findOne(member.id);

try {
var amount = await specialArg(interaction.options.getString('amount'), Number.MAX_SAFE_INTEGER);
var amount = await numerize(interaction.options.getString('amount'), Number.MAX_SAFE_INTEGER);
} catch {
await instance.editReply(interaction, {
content: instance.getMessage(interaction, 'BAD_VALUE', {
Expand All @@ -520,7 +521,7 @@ module.exports = {
}

try {
var price = await specialArg(interaction.options.getString('price'), Number.MAX_SAFE_INTEGER);
var price = await numerize(interaction.options.getString('price'), Number.MAX_SAFE_INTEGER);
} catch {
await instance.editReply(interaction, {
content: instance.getMessage(interaction, 'BAD_VALUE', {
Expand Down Expand Up @@ -602,7 +603,7 @@ module.exports = {
}

try {
var amount = await specialArg(interaction.options.getString('amount'), userFile.inventory.get(itemKey));
var amount = await numerize(interaction.options.getString('amount'), userFile.inventory.get(itemKey));
} catch {
await instance.editReply(interaction, {
content: instance.getMessage(interaction, 'BAD_VALUE', {
Expand All @@ -621,7 +622,7 @@ module.exports = {
}

try {
var price = await specialArg(interaction.options.getString('price'), Number.MAX_SAFE_INTEGER);
var price = await numerize(interaction.options.getString('price'), Number.MAX_SAFE_INTEGER);
} catch {
await instance.editReply(interaction, {
content: instance.getMessage(interaction, 'BAD_VALUE', {
Expand Down
5 changes: 3 additions & 2 deletions src/commands/economy/roulette.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { specialArg, randint, format } = require('../../utils/functions.js');
const { randint, format } = require('../../utils/functions.js');
const { SlashCommandBuilder } = require('discord.js');
const { numerize } = require('numerize');

module.exports = {
data: new SlashCommandBuilder()
Expand Down Expand Up @@ -98,7 +99,7 @@ module.exports = {
const falcoins = interaction.options.getString('falcoins');
const player = await database.player.findOne(user.id);
try {
var bet = await specialArg(falcoins, player.falcoins);
var bet = await numerize(falcoins, player.falcoins);
} catch {
await instance.editReply(interaction, {
content: instance.getMessage(interaction, 'BAD_VALUE', {
Expand Down
6 changes: 3 additions & 3 deletions src/commands/economy/russianroulette.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { SlashCommandBuilder, time } = require('discord.js');
const { specialArg, randint, format, buttons } = require('../../utils/functions.js');
const { log } = require('console');
const { randint, format, buttons } = require('../../utils/functions.js');
const { numerize } = require('numerize');

module.exports = {
data: new SlashCommandBuilder()
Expand Down Expand Up @@ -31,7 +31,7 @@ module.exports = {
const falcoins = interaction.options.getString('falcoins');
const player = await database.player.findOne(user.id);
try {
var bet = await specialArg(falcoins, player.falcoins);
var bet = await numerize(falcoins, player.falcoins);
} catch {
await instance.editReply(interaction, {
content: instance.getMessage(interaction, 'BAD_VALUE', {
Expand Down
5 changes: 3 additions & 2 deletions src/commands/economy/slot.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { specialArg, format, pick } = require('../../utils/functions.js');
const { format, pick } = require('../../utils/functions.js');
const { SlashCommandBuilder } = require('discord.js');
const { numerize } = require('numerize');

module.exports = {
data: new SlashCommandBuilder()
Expand Down Expand Up @@ -30,7 +31,7 @@ module.exports = {
const falcoins = interaction.options.getString('falcoins');
const player = await database.player.findOne(user.id);
try {
var bet = await specialArg(falcoins, player.falcoins);
var bet = await numerize(falcoins, player.falcoins);
} catch {
await instance.editReply(interaction, {
content: instance.getMessage(interaction, 'BAD_VALUE', {
Expand Down
5 changes: 3 additions & 2 deletions src/commands/economy/snakeeyes.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { specialArg, format, randint } = require('../../utils/functions.js');
const { format, randint } = require('../../utils/functions.js');
const { SlashCommandBuilder } = require('discord.js');
const { numerize } = require('numerize');

module.exports = {
data: new SlashCommandBuilder()
Expand Down Expand Up @@ -31,7 +32,7 @@ module.exports = {
const player = await database.player.findOne(user.id);

try {
var bet = await specialArg(falcoins, player.falcoins);
var bet = await numerize(falcoins, player.falcoins);
} catch {
await instance.editReply(interaction, {
content: instance.getMessage(interaction, 'BAD_VALUE', {
Expand Down
1 change: 0 additions & 1 deletion src/commands/economy/vote.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const { msToTime, format, checkIfUserIsPremium } = require('../../utils/functions.js');
require('dotenv').config();
const { SlashCommandBuilder } = require('discord.js');

module.exports = {
Expand Down
2 changes: 0 additions & 2 deletions src/handlers/commandHandler.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
require('dotenv').config();

async function loadCommands(instance, client) {
const { loadFiles } = require('../utils/fileLoader');

Expand Down
1 change: 0 additions & 1 deletion src/handlers/databaseHandler.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const mongoose = require('mongoose');
require('dotenv').config();
const interestSchema = require('../schemas/interest-schema.js');
const lotterySchema = require('../schemas/lotto-schema.js');

Expand Down
1 change: 0 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const { ShardingManager } = require('discord.js'); //imports the sharding manager
require('dotenv').config();

const manager = new ShardingManager('./src/bot.js', {
token: process.env.TOKEN,
Expand Down
Loading