From 5bd05272af32848184195e63acdfd3731f28cead Mon Sep 17 00:00:00 2001 From: Maximus7474 Date: Fri, 13 Dec 2024 12:03:39 +0100 Subject: [PATCH] rf: remove all imports of @discordjs/builders and replace with discord.js --- deploy/find_commands.js | 2 +- src/commands/clanHandler.js | 3 +-- src/commands/help.js | 2 +- src/commands/inviteMe.js | 3 +-- src/commands/patchnotes.js | 3 +-- src/commands/serverSearch.js | 3 +-- src/commands/serverStatus.js | 3 +-- src/commands/serverStatusHandler.js | 3 +-- src/commands/vehicleSearcher.js | 3 +-- src/commands/viewClans.js | 2 +- src/utils/initialisation/setup_commands.js | 2 +- 11 files changed, 11 insertions(+), 18 deletions(-) diff --git a/deploy/find_commands.js b/deploy/find_commands.js index c634a89..94792cd 100644 --- a/deploy/find_commands.js +++ b/deploy/find_commands.js @@ -2,7 +2,7 @@ const fs = require('fs'); const path = require('path'); const log = new require('../src/utils/logger.js'); const logger = new log("Command loader"); -const { SlashCommandBuilder } = require('@discordjs/builders'); +const { SlashCommandBuilder } = require('discord.js'); const path_to_commands = path.join(__dirname, '/../src/commands/'); function getAllJsFiles(dirPath, arrayOfFiles) { diff --git a/src/commands/clanHandler.js b/src/commands/clanHandler.js index 522a038..afa8dee 100644 --- a/src/commands/clanHandler.js +++ b/src/commands/clanHandler.js @@ -1,5 +1,4 @@ -const { SlashCommandBuilder } = require('@discordjs/builders'); -const { PermissionsBitField, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, ModalBuilder, TextInputBuilder, TextInputStyle } = require('discord.js'); +const { PermissionsBitField, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, ModalBuilder, TextInputBuilder, TextInputStyle, SlashCommandBuilder } = require('discord.js'); const { executeStatement, executeQuery } = require('../utils/database/sqliteHandler'); diff --git a/src/commands/help.js b/src/commands/help.js index 8ca571e..943d030 100644 --- a/src/commands/help.js +++ b/src/commands/help.js @@ -1,4 +1,4 @@ -// const { SlashCommandBuilder } = require('@discordjs/builders'); +// const { SlashCommandBuilder } = require('discord.js'); // module.exports = { // register_command: new SlashCommandBuilder() diff --git a/src/commands/inviteMe.js b/src/commands/inviteMe.js index 2303a79..e81a116 100644 --- a/src/commands/inviteMe.js +++ b/src/commands/inviteMe.js @@ -1,5 +1,4 @@ -const { SlashCommandBuilder } = require('@discordjs/builders'); -const { EmbedBuilder } = require('discord.js'); +const { SlashCommandBuilder, EmbedBuilder } = require('discord.js'); module.exports = { register_command: new SlashCommandBuilder() diff --git a/src/commands/patchnotes.js b/src/commands/patchnotes.js index 9721b5f..61a615e 100644 --- a/src/commands/patchnotes.js +++ b/src/commands/patchnotes.js @@ -1,5 +1,4 @@ -const { ButtonStyle } = require('discord.js'); -const { SlashCommandBuilder, EmbedBuilder, ButtonBuilder, ActionRowBuilder } = require('@discordjs/builders'); +const { ButtonStyle, SlashCommandBuilder, EmbedBuilder, ButtonBuilder, ActionRowBuilder } = require('discord.js'); const https = require('https'); const assert = require('assert'); diff --git a/src/commands/serverSearch.js b/src/commands/serverSearch.js index 11231d1..11cd042 100644 --- a/src/commands/serverSearch.js +++ b/src/commands/serverSearch.js @@ -1,6 +1,5 @@ -const { SlashCommandBuilder } = require('@discordjs/builders'); +const { SlashCommandBuilder, EmbedBuilder } = require('discord.js'); const { queryBattleMetrics } = require('../utils/query/battlemetricsQuery'); -const { EmbedBuilder } = require('discord.js'); const { getOrdinalSuffix, emojiForStatus, capitalizeFirstLetter } = require('../utils/functions'); diff --git a/src/commands/serverStatus.js b/src/commands/serverStatus.js index 3f275e3..484c463 100644 --- a/src/commands/serverStatus.js +++ b/src/commands/serverStatus.js @@ -1,5 +1,4 @@ -const { SlashCommandBuilder } = require('@discordjs/builders'); -const { PermissionsBitField, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require('discord.js'); +const { PermissionsBitField, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, SlashCommandBuilder } = require('discord.js'); const { executeStatement, executeQuery } = require('../utils/database/sqliteHandler'); const { queryBattleMetrics } = require('../utils/query/battlemetricsQuery'); diff --git a/src/commands/serverStatusHandler.js b/src/commands/serverStatusHandler.js index 242dad3..487cd1c 100644 --- a/src/commands/serverStatusHandler.js +++ b/src/commands/serverStatusHandler.js @@ -1,5 +1,4 @@ -const { SlashCommandBuilder } = require('@discordjs/builders'); -const { PermissionsBitField, EmbedBuilder } = require('discord.js'); +const { PermissionsBitField, EmbedBuilder, SlashCommandBuilder } = require('discord.js'); const { executeStatement, executeQuery } = require('../utils/database/sqliteHandler'); diff --git a/src/commands/vehicleSearcher.js b/src/commands/vehicleSearcher.js index 80f0b7c..67a4547 100644 --- a/src/commands/vehicleSearcher.js +++ b/src/commands/vehicleSearcher.js @@ -1,7 +1,6 @@ -const { SlashCommandBuilder } = require('@discordjs/builders'); +const { SlashCommandBuilder, EmbedBuilder } = require('discord.js'); const VehicleData = require('../../data/vehicleInfo.json'); -const { EmbedBuilder } = require('discord.js'); const thumbnailImage = (team) => { if (team === "Allies") return "https://r2.fivemanage.com/pub/ngxgy4wfhtv7.png"; diff --git a/src/commands/viewClans.js b/src/commands/viewClans.js index 2673b1a..6f26a54 100644 --- a/src/commands/viewClans.js +++ b/src/commands/viewClans.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, EmbedBuilder, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, ActionRowBuilder } = require('@discordjs/builders'); +const { SlashCommandBuilder, EmbedBuilder, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, ActionRowBuilder } = require('discord.js'); const { executeQuery } = require('../utils/database/sqliteHandler'); const log = require('../utils/logger'); diff --git a/src/utils/initialisation/setup_commands.js b/src/utils/initialisation/setup_commands.js index d653901..b8f0ecb 100644 --- a/src/utils/initialisation/setup_commands.js +++ b/src/utils/initialisation/setup_commands.js @@ -1,7 +1,7 @@ const fs = require('fs') const log = new require('../logger.js') const logger = new log("Command loader") -const { SlashCommandBuilder } = require('@discordjs/builders'); +const { SlashCommandBuilder } = require('discord.js'); const path_to_commands = __dirname + '/../../commands/' module.exports = (client) => {