diff --git a/commands/.gitignore b/commands/.gitignore deleted file mode 100644 index 47fe0b3..0000000 --- a/commands/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -.env -/node_modules -.vscode -json.sqlite -mybot.js -changelog.js \ No newline at end of file diff --git a/commands/LICENSE b/commands/LICENSE deleted file mode 100644 index 261eeb9..0000000 --- a/commands/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/commands/PPgestionBot.png b/commands/PPgestionBot.png deleted file mode 100644 index b11649e..0000000 Binary files a/commands/PPgestionBot.png and /dev/null differ diff --git a/commands/README.md b/commands/README.md deleted file mode 100644 index e9574b9..0000000 --- a/commands/README.md +++ /dev/null @@ -1,59 +0,0 @@ -# Nom du Bot Discord - -![Logo du Bot](PPgestionBot.png) - -## Description - -Le Bot Discord Gestion est un bot multifonction développé en JavaScript utilisant la bibliothèque Discord.js. Il est conçu pour offrir diverses fonctionnalités utiles pour les serveurs Discord. - -## Fonctionnalités - -- **Commandes de base :** Commandes telles que !help, !ping, etc. -- **Modération :** Commandes de modération pour gérer les utilisateurs et les messages. -- **Fun :** Commandes amusantes pour divertir les membres du serveur. -- **Musique :** Lecture de musique depuis YouTube et autres plateformes. - -## Installation - -1. Cloner le référentiel : - -```bash -git clone https://github.com/votre_utilisateur/nom-du-bot.git -``` - -2. Installer les dépendances : - -``` -cd nom-du-bot -npm install -``` - -3. Ajouter le fichier .env avec votre token bot. - -``` -TOKEN=votre_token_ici -``` - -4. Lancer le bot : - -```js -node main.js -``` - -## Contribuer - -Si vous souhaitez contribuer à ce projet, suivez ces étapes : - -1. Fork du projet -2. Créer une branche pour votre fonctionnalité (git checkout -b fonctionnalite/ma-fonctionnalite) -3. Commit de vos modifications (git commit -am 'Ajout de la fonctionnalité ma-fonctionnalite') -4. Push vers la branche (git push origin fonctionnalite/ma-fonctionnalite) -5. Ouvrir une Pull Request - -## Auteurs -tutur33 - Développeur principal -valou336 - Développeur principal - -## Licence - -Ce projet est sous licence Apache 2.0. Consultez le fichier LICENSE pour plus de détails. diff --git a/commands/events/client/interactionCreate.js b/commands/events/client/interactionCreate.js new file mode 100644 index 0000000..907fcb8 --- /dev/null +++ b/commands/events/client/interactionCreate.js @@ -0,0 +1,11 @@ +const { Events, InteractionType } = require("discord.js"); + +module.exports = { + name: Events.InteractionCreate, + async execute(client, interaction) { + if (interaction.type === InteractionType.ApplicationCommand) { + const command = client.commands.get(interaction.commandName); + await command.execute(interaction, client); + } + }, +}; diff --git a/commands/events/client/ready.js b/commands/events/client/ready.js new file mode 100644 index 0000000..c356fd0 --- /dev/null +++ b/commands/events/client/ready.js @@ -0,0 +1,49 @@ +const sqlite3 = require('sqlite3').verbose(); +const { Events } = require('discord.js'); +const permissions = require('../../permissions.json'); + +module.exports = { + name: Events.ClientReady, + async execute(client) { + const db = new sqlite3.Database('myDatabase.db', (err) => { + if (err) { + console.error(err.message); + } + console.log('Connected to the SQLite database.'); + }); + + let permissionsData = await new Promise((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [client.user.id], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); + + if (!permissionsData.permissions) { + permissionsData.permissions = {}; + } + + permissionsData.permissions = permissions; + const permissionsJson = JSON.stringify(permissionsData); + + db.run('INSERT OR REPLACE INTO gestion (id, value) VALUES (?, ?)', [client.user.id, permissionsJson], (err) => { + if (err) { + console.error(err.message); + } else { + console.log(`Les permissions ont été chargées pour le bot ${client.user.tag}`); + } + }); + + console.log(`Le bot ${client.user.tag} est en ligne`); + process.on('uncaughtException', (error) => { + console.error('Uncaught Exception:', error); + }); + + process.on('unhandledRejection', (reason, promise) => { + console.error('Unhandled Rejection at:', promise, 'reason:', reason); + }); + }, +}; \ No newline at end of file diff --git a/commands/events/gestion/bl.js b/commands/events/gestion/bl.js new file mode 100644 index 0000000..ffed14f --- /dev/null +++ b/commands/events/gestion/bl.js @@ -0,0 +1,68 @@ +const { EmbedBuilder } = require('discord.js'); +const sqlite3 = require('sqlite3').verbose(); + +// Setup SQLite3 database connection +const db = new sqlite3.Database('myDatabase.db'); + +module.exports = { + name: 'greet', + description: 'Ajoute ou supprime un salon des greet', + emote: '👋', + utilisation: 'greet ', + category: 'gestion', + + async execute(message, args) { + const botId = message.client.user.id; + const guildId = message.guild.id; + + const channelId = args[0] ? args[0].replace(/<#|>/g, '') : message.channel.id; + + // Query the greetings data from the SQLite3 database + let greet = await new EmbedBuilder((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); + + // Access the specific guild's greetings + let guildGreetings = greet[guildId] || []; + + const index = guildGreetings.findIndex(greeting => greeting.channelId === channelId); + + if (index !== -1) { + guildGreetings.splice(index, 1); + greet[guildId] = guildGreetings; + db.run('INSERT OR REPLACE INTO gestion (id, value) VALUES (?, ?)', [botId, JSON.stringify(greet)], (err) => { + if (err) { + console.error(err.message); + } + }); + const embed = new EmbedBuilder() + .setDescription(`Le salon <#${channelId}> a été retiré de la liste des salutations.`) + .setColor('#0099ff'); + message.channel.send({ embeds: [embed] }); + } else if (guildGreetings.length < 5) { + guildGreetings.push({ channelId }); + + greet[guildId] = guildGreetings; + db.run('INSERT OR REPLACE INTO gestion (id, value) VALUES (?, ?)', [botId, JSON.stringify(greet)], (err) => { + if (err) { + console.error(err.message); + } + }); + const embed = new EmbedBuilder() + .setDescription(`Le salon <#${channelId}> a été ajouté à la liste des salutations.`) + .setColor('#0099ff'); + message.channel.send({ embeds: [embed] }); + } else { + const embed = new EmbedBuilder() + .setDescription('Il y a déjà 5 salons dans la liste des salutations. Vous ne pouvez pas en ajouter d\'autres.') + .setColor('#ff0000'); + message.channel.send({ embeds: [embed] }); + } + }, +}; \ No newline at end of file diff --git a/commands/events/gestion/buttongestion.js b/commands/events/gestion/buttongestion.js new file mode 100644 index 0000000..a7b1a3a --- /dev/null +++ b/commands/events/gestion/buttongestion.js @@ -0,0 +1,37 @@ +const {Events} = require("discord.js") +const db = require('quick.db'); +const PrevnameDb = new db.table("prevname"); +const sqlite3 = require('sqlite3').verbose(); +const db2 = new sqlite3.Database('myDatabase.db'); +module.exports = { + name: Events.InteractionCreate, + async execute(interaction, client) { + const botId = client.user.id; + let owners = await new Promise((resolve, reject) => { + db2.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value).owners || {} : {}); + }); + }); + if (!interaction.isButton()) return; + if (interaction.customId.startsWith('deletesuggestion_')) { + const userId= interaction.customId.split('_')[1]; + if (interaction.user.id !== userId && !Object.keys(owners).includes(interaction.user.id)) { + await interaction.reply({ content: "vous n'avez pas la permission de supprimer cette suggestion.", ephemeral: true }); + return; + } + await interaction.message.delete(); + } else if (interaction.customId.startsWith('deleteprevnames_')) { + const userId = interaction.customId.split('_')[1]; + if (interaction.user.id !== userId) { + await interaction.reply({ content: "vous n'avez pas la permission de suprimer cette suggestion.", ephemeral: true }); + return; + } + await PrevnameDb.delete(userId) + await interaction.reply({ content: "Vos prevname on etait correctement supprimer.", ephemeral: true }); + } + }, +}; \ No newline at end of file diff --git a/commands/events/gestion/greet.js b/commands/events/gestion/greet.js new file mode 100644 index 0000000..27a2890 --- /dev/null +++ b/commands/events/gestion/greet.js @@ -0,0 +1,47 @@ +const sqlite3 = require('sqlite3').verbose(); +const { Events } = require("discord.js"); +const db = new sqlite3.Database('myDatabase.db'); + +module.exports = { + name: Events.GuildMemberAdd, + async execute(member) { + const botId = member.client.user.id; + const guildId = member.guild.id; + + let greet = await new Promise((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); + const guildGreetings = greet[guildId] || []; + + if (guildGreetings.length > 0) { + const welcomeMessage = `Bienvenue <@${member.id}> sur le serveur ${member.guild.name} !`; + const messagePromises = []; + for (const greeting of guildGreetings) { + try { + const channel = await member.guild.channels.fetch(greeting.channelId); + if (channel && channel.type === 0) { + messagePromises.push( + channel.send(welcomeMessage) + .then(message => { + setTimeout(() => message.delete(), 1000); + }) + ); + } + } catch (error) { + console.error(error); + } + } + try { + await Promise.all(messagePromises); + } catch (error) { + console.error(error); + } + } + }, +}; \ No newline at end of file diff --git a/commands/events/gestion/guildMemberAdd.js b/commands/events/gestion/guildMemberAdd.js new file mode 100644 index 0000000..10a18f5 --- /dev/null +++ b/commands/events/gestion/guildMemberAdd.js @@ -0,0 +1,60 @@ +const db = require('quick.db'); +const GestionDb = new db.table('gestion'); +const sqlite3 = require('sqlite3').verbose(); +const db2 = new sqlite3.Database('myDatabase.db'); +const {Events} = require("discord.js") +module.exports = { + name: Events.GuildMemberAdd, + async execute(oldMember, newMember) { + const botId = newMember.client.user.id; + const guildId = newMember.guild.id; + + let data = await new Promise((resolve, reject) => { + db2.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); + + // Access the specific guild's blrank data + let blrank = data.blrank || {}; + + if (blrank[guildId] && blrank[guildId][newMember.id]) { + const addedRoles = newMember.roles.cache.filter(role => !oldMember.roles.cache.has(role.id)); + addedRoles.forEach(async role => { + try { + await newMember.roles.remove(role); + } catch (error) { + console.error(`Erreur lors de la suppression du rôle <@&${role.id}> pour le membre ${newMember.user.tag}:`, error); + } + }); + return; + } + const limitedRoles = GestionDb.get(`${botId}.${guildId}.rolelimits`) || []; + const addedRoles = newMember.roles.cache.filter(role => !oldMember.roles.cache.has(role.id)); + + addedRoles.forEach(async role => { + const limitedRole = limitedRoles.find(r => r.id === role.id); + if (limitedRole) { + const memberCount = newMember.guild.members.cache.filter(m => m.roles.cache.has(role.id)).size; + if (limitedRole.limit === 0) { + try { + await newMember.roles.remove(role); + } catch (error) { + console.error(`Erreur lors de la suppression du rôle <@&${role.id}> pour le membre ${newMember.user.tag}:`, error); + } + } + if (memberCount > limitedRole.limit) { + try { + await newMember.roles.remove(role); + } catch (error) { + console.error(`Erreur lors de la suppression du rôle <@&${role.id}> pour le membre ${newMember.user.tag}:`, error); + } + } + } + }); + }, +}; \ No newline at end of file diff --git a/commands/events/gestion/memberconnecte.js b/commands/events/gestion/memberconnecte.js new file mode 100644 index 0000000..f5e2ff6 --- /dev/null +++ b/commands/events/gestion/memberconnecte.js @@ -0,0 +1,46 @@ +const sqlite3 = require('sqlite3').verbose(); +const { Events } = require("discord.js"); + +// Setup SQLite3 database connection +const db = new sqlite3.Database('myDatabase.db'); + +module.exports = { + name: Events.VoiceStateUpdate, + async execute(oldState, newState) { + if (!oldState.channelId && newState.channelId) { + const guildId = newState.guild.id; + const botId = newState.client.user.id; + const channelId = newState.channelId; + + // Query the bot's data from the SQLite3 database + let data = await new Promise((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); + + // Access the specific guild's rolevocal data + let rolevocal = data.rolevocal || {}; + let guildRoles = rolevocal[guildId] || {}; + let channelRoles = guildRoles[channelId] || []; + + if (channelRoles.length > 0) { + const member = newState.member; + for (const roleId of channelRoles) { + const role = newState.guild.roles.cache.get(roleId); + if (role) { + try { + await member.roles.add(role); + } catch (error) { + console.error(`Erreur lors de l'ajout du rôle ${roleId} à l'utilisateur ${member.id}:`, error); + } + } + } + } + } + }, +}; \ No newline at end of file diff --git a/commands/events/gestion/messageCreate.js b/commands/events/gestion/messageCreate.js new file mode 100644 index 0000000..91983df --- /dev/null +++ b/commands/events/gestion/messageCreate.js @@ -0,0 +1,45 @@ +const { ActionRowBuilder, ButtonBuilder, ButtonStyle, EmbedBuilder } = require('discord.js'); +const sqlite3 = require('sqlite3').verbose(); +const { Events } = require("discord.js"); +const db = new sqlite3.Database('myDatabase.db'); + +module.exports = { + name: Events.MessageCreate, + async execute(message) { + const botId = message.client.user.id; + const guildId = message.guild.id; + + let data = await new Promise((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); + const suggestChannelId = data.suggestChannel && data.suggestChannel[guildId]; + + if (message.channel.id === suggestChannelId && !message.author.bot) { + await message.delete(); + + const embed = new EmbedBuilder() + .setAuthor({ name: message.author.tag, iconURL: message.author.displayAvatarURL() }) + .setDescription(message.content || 'Aucun contenu fourni') + .setFooter({ text: `${message.guild.name} | ${message.client.user.username}`, }) + .setColor('#409CED'); + + const row = new ActionRowBuilder() + .addComponents( + new ButtonBuilder() + .setCustomId(`deletesuggestion_${message.author.id}`) + .setLabel('Supprimer') + .setStyle(ButtonStyle.Danger) + ); + + const suggestionMessage = await message.channel.send({ embeds: [embed], components: [row] }); + suggestionMessage.react('👎') + suggestionMessage.react('👍') + } + }, +}; \ No newline at end of file diff --git a/commands/events/gestion/messageDelete.js b/commands/events/gestion/messageDelete.js new file mode 100644 index 0000000..1ab3888 --- /dev/null +++ b/commands/events/gestion/messageDelete.js @@ -0,0 +1,15 @@ +const {Events} = require("discord.js") + +module.exports = { + name: Events.MessageDelete, + once: false, + async execute(message, client) { + if (message.author.bot) return; + + client.snipes.set(message.channel.id, { + content: message.content, + author: message.author.id, + timestamp: Date.now(), + }); + }, +}; \ No newline at end of file diff --git a/commands/events/gestion/prevname.js b/commands/events/gestion/prevname.js new file mode 100644 index 0000000..1d1569c --- /dev/null +++ b/commands/events/gestion/prevname.js @@ -0,0 +1,20 @@ +const { Events } = require("discord.js"); +const db = require('quick.db'); +const PrevnameDb = new db.table("prevname"); +module.exports = { + name: Events.GuildMemberUpdate, + async execute(oldMember, newMember) { + if (oldMember.displayName !== newMember.displayName) { + let changeData = { + oldName: oldMember.displayName, + newName: newMember.displayName, + changeDate: Math.floor(Date.now() / 1000) + }; + let nameChanges = PrevnameDb.get(`${newMember.id}.nameChanges`) || []; + + nameChanges.push(changeData); + + PrevnameDb.set(`${newMember.id}.nameChanges`, nameChanges); + } + }, +}; \ No newline at end of file diff --git a/commands/fonction.js b/commands/fonction.js index 5466333..9b76232 100644 --- a/commands/fonction.js +++ b/commands/fonction.js @@ -1,32 +1,36 @@ -const db = require('quick.db'); -const GestionDb = new db.table('gestion') +const sqlite3 = require('sqlite3').verbose(); +const db = new sqlite3.Database('myDatabase.db'); async function getPermissionLevel(member, client) { const botId = client.user.id; + const guildId = member.guild.id; const buyerId = ['1003985920162287696', '671763971803447298']; - let owners = await GestionDb.get(`${botId}.owners`) || {}; + + let data = await new Promise((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); + let owners = data.owners || {}; if (buyerId.includes(member.id)) { - return 11; + return 11; } if (owners[member.id]) { - return 10; + return 10; } - let highestPermission = 0; - try { - for (let i = 1; i <= 9; i++) { - const roleIds = await GestionDb.get(`${botId}.${member.guild.id}.p${i}`); - if (roleIds) { - if (!Array.isArray(roleIds)) { - roleIds = [roleIds]; - } - if (roleIds.some(id => member.roles.cache.has(id))) { - highestPermission = Math.max(highestPermission, i); - } + let highestPermission = 0; + for (let i = 1; i <= 9; i++) { + const roleIds = data.permissions && data.permissions[guildId] && data.permissions[guildId].p && data.permissions[guildId].p[i]; + if (roleIds) { + if (roleIds.some(id => member.roles.cache.has(id))) { + highestPermission = Math.max(highestPermission, i); } } - return highestPermission; - } catch { - return highestPermission; } + return highestPermission; } module.exports = { getPermissionLevel }; \ No newline at end of file diff --git a/commands/game/8ball.js b/commands/game/8ball.js index 5b300fb..2631142 100644 --- a/commands/game/8ball.js +++ b/commands/game/8ball.js @@ -31,6 +31,7 @@ module.exports = { 'Mes sources disent non.', 'Les perspectives ne sont pas bonnes.', 'Très douteux.', + "Il est difficile de dire avec certitude à ce stade.", ]; const response = responses[Math.floor(Math.random() * responses.length)]; diff --git a/commands/gestion/blrank.js b/commands/gestion/blrank.js index d714f78..de2ec30 100644 --- a/commands/gestion/blrank.js +++ b/commands/gestion/blrank.js @@ -1,6 +1,5 @@ -const { EmbedBuilder} = require('discord.js'); -const db = require('quick.db'); -const GestionDb = new db.table("gestion"); +const { EmbedBuilder } = require('discord.js'); +const sqlite3 = require('sqlite3').verbose(); module.exports = { name: 'blrank', @@ -10,29 +9,61 @@ module.exports = { category: 'gestion', async execute(message, args, client) { + const db = new sqlite3.Database('myDatabase.db'); const botId = message.client.user.id; const guildId = message.guild.id; - + if (args.length > 0) { const userId = args[0].replace(/<@!?(\d+)>/, '$1'); - let blrank = await GestionDb.get(`${botId}.${guildId}.blrank`) || {}; - - if (blrank[userId]) { - delete blrank[userId]; - await GestionDb.set(`${botId}.${guildId}.blrank`, blrank); + let data = await new Promise((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); + + if (!data.blrank) { + data.blrank = {}; + } + + if (data.blrank[userId]) { + delete data.blrank[userId]; + db.run('INSERT OR REPLACE INTO gestion (id, value) VALUES (?, ?)', [botId, JSON.stringify(data)], (err) => { + if (err) { + console.error(err.message); + } + }); message.reply('Utilisateur retiré de la blrank.'); } else { - blrank[userId] = true; - await GestionDb.set(`${botId}.${guildId}.blrank`, blrank); + data.blrank[userId] = true; + db.run('INSERT OR REPLACE INTO gestion (id, value) VALUES (?, ?)', [botId, JSON.stringify(data)], (err) => { + if (err) { + console.error(err.message); + } + }); message.reply('Utilisateur ajouté à la blrank.'); } } else { - let blrank = await GestionDb.get(`${botId}.${guildId}.blrank`) || {}; - const embed = new EmbedBuilder() + let data = await new Promise((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); + + const blrank = data.blrank || {}; + const embed = new EmbedBuilder() .setTitle('Blrank') .setDescription(Object.keys(blrank).map(id => `<@${id}>`).join('\n') || 'Aucun utilisateur sur la liste blanche') .setFooter({ text: message.client.user.username, iconURL: client.user.displayAvatarURL({dynamic: true})}); + message.channel.send({ embeds: [embed] }); } }, diff --git a/commands/gestion/change.js b/commands/gestion/change.js index 845e7aa..661ea90 100644 --- a/commands/gestion/change.js +++ b/commands/gestion/change.js @@ -1,7 +1,7 @@ const fs = require('fs'); const path = require('path'); -const db = require('quick.db'); -const GestionDb = new db.table("gestion"); +const sqlite3 = require('sqlite3').verbose(); + module.exports = { name: 'change', aliases: ['permchange'], @@ -9,11 +9,12 @@ module.exports = { emote: '🔄', utilisation: 'change ', category: 'botcontrol', + async execute(message, args, client) { const botId = client.user.id; - const unchangeableCommands = ['owner', 'unowner','buyer']; + const unchangeableCommands = ['owner', 'unowner', 'buyer']; - if (args.length < 2) { + if (args.length < 2) { return message.reply('Veuillez spécifier une commande et un niveau de permission.'); } @@ -21,16 +22,13 @@ module.exports = { let permissionLevel; if (args[1] === 'owner') { - permissionLevel = 10; - } - - else if (args[1] === 'buyer') { - permissionLevel = 11; - } - else { + permissionLevel = 10; + } else if (args[1] === 'buyer') { + permissionLevel = 11; + } else { permissionLevel = parseInt(args[1]); - if (isNaN(permissionLevel) || permissionLevel < 0 || permissionLevel > 9) { - return message.reply('Veuillez spécifier un niveau de permission valide (entre 0 et 9).'); + if (isNaN(permissionLevel) || permissionLevel < 0 || permissionLevel > 9) { + return message.reply('Veuillez spécifier un niveau de permission valide (entre 0 et 9).'); } } @@ -42,10 +40,28 @@ module.exports = { return message.reply('Cette commande n\'existe pas.'); } - let permissions = await GestionDb.get(`${botId}.permissions`); - permissions[commandName] = permissionLevel; - await GestionDb.set(`${botId}.permissions`, permissions); + const db = new sqlite3.Database('myDatabase.db'); + let permissions = await new Promise((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); - message.reply(`Le niveau de permission de la commande ${commandName} a été changé à ${args[0].toLowerCase()}.`); + if (!permissions.permissions) { + permissions.permissions = {}; + } + + permissions.permissions[commandName] = permissionLevel; + db.run('INSERT OR REPLACE INTO gestion (id, value) VALUES (?, ?)', [botId, JSON.stringify(permissions)], (err) => { + if (err) { + console.error(err.message); + } + }); + + message.reply(`Le niveau de permission de la commande ${commandName} a été changé à ${permissionLevel}.`); }, }; \ No newline at end of file diff --git a/commands/gestion/delperm.js b/commands/gestion/delperm.js index 92ae1fc..ed49e20 100644 --- a/commands/gestion/delperm.js +++ b/commands/gestion/delperm.js @@ -1,46 +1,75 @@ -const db = require('quick.db'); -const GestionDb = new db.table("gestion"); +const sqlite3 = require('sqlite3').verbose(); module.exports = { name: 'delperm', description: 'Supprime un rôle d\'un niveau de permission ou d\'une commande', - emote: '❌', + emote: '❌', utilisation: 'delperm @role', category: 'gestion', + async execute(message, args, client) { + const db = new sqlite3.Database('myDatabase.db'); const botId = client.user.id; + const guildId = message.guild.id; const permissionOrCommand = args[0].toLowerCase(); const role = message.mentions.roles.first(); if (!role) { return message.reply('Veuillez mentionner un rôle valide.'); } - if (['1', '2', '3', '4', '5', '6', '7', '8', '9'].includes(permissionOrCommand)) { - let roleIds = await GestionDb.get(`${botId}.${message.guild.id}.p${permissionOrCommand}`); - if (roleIds) { - if (!Array.isArray(roleIds)) { - roleIds = [roleIds]; + + let data = await new Promise((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); } - const index = roleIds.indexOf(role.id); + resolve(row ? JSON.parse(row.value) : {}); + }); + }); + + if (!data.permissions) { + data.permissions = {}; + } + + if (['1', '2', '3', '4', '5', '6', '7', '8', '9'].includes(permissionOrCommand)) { + if (!data.permissions[guildId]) { + data.permissions[guildId] = {}; + } + if (!data.permissions[guildId].p) { + data.permissions[guildId].p = {}; + } + if (data.permissions[guildId].p[permissionOrCommand]) { + const index = data.permissions[guildId].p[permissionOrCommand].indexOf(role.id); if (index !== -1) { - roleIds.splice(index, 1); - await GestionDb.set(`${botId}.${message.guild.id}.p${permissionOrCommand}`, roleIds); + data.permissions[guildId].p[permissionOrCommand].splice(index, 1); + db.run('INSERT OR REPLACE INTO gestion (id, value) VALUES (?, ?)', [botId, JSON.stringify(data)], (err) => { + if (err) { + console.error(err.message); + } + }); } } message.reply(`Le rôle pour ${permissionOrCommand} a été supprimé.`); } else { - let roleIds = await GestionDb.get(`${botId}.${message.guild.id}.c${permissionOrCommand}`); - if (roleIds) { - if (!Array.isArray(roleIds)) { - roleIds = [roleIds]; - } - const index = roleIds.indexOf(role.id); + if (!data.permissions[guildId]) { + data.permissions[guildId] = {}; + } + if (!data.permissions[guildId].c) { + data.permissions[guildId].c = {}; + } + if (data.permissions[guildId].c[permissionOrCommand]) { + const index = data.permissions[guildId].c[permissionOrCommand].indexOf(role.id); if (index !== -1) { - roleIds.splice(index, 1); - await GestionDb.set(`${botId}.${message.guild.id}.c${permissionOrCommand}`, roleIds); + data.permissions[guildId].c[permissionOrCommand].splice(index, 1); + db.run('INSERT OR REPLACE INTO gestion (id, value) VALUES (?, ?)', [botId, JSON.stringify(data)], (err) => { + if (err) { + console.error(err.message); + } + }); } } - message.reply(`L commande ${permissionOrCommand} a été supprimé du role.`); + message.reply(`La commande ${permissionOrCommand} a été supprimée du rôle.`); } }, }; \ No newline at end of file diff --git a/commands/gestion/greet.js b/commands/gestion/greet.js index 3ad3cf0..adbbec8 100644 --- a/commands/gestion/greet.js +++ b/commands/gestion/greet.js @@ -1,6 +1,6 @@ const { EmbedBuilder } = require('discord.js'); -const db = require('quick.db'); -const GestionDb = new db.table('gestion'); +const sqlite3 = require('sqlite3').verbose(); +const db = new sqlite3.Database('myDatabase.db'); module.exports = { name: 'greet', @@ -12,29 +12,46 @@ module.exports = { async execute(message, args) { const botId = message.client.user.id; const guildId = message.guild.id; - const guildGreetings = GestionDb.get(`${botId}.${guildId}.greetings`) || []; const channelId = args[0] ? args[0].replace(/<#|>/g, '') : message.channel.id; + let guildGreetings = await new Promise((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [`${botId}.${guildId}.greetings`], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : []); + }); + }); + const index = guildGreetings.findIndex(greeting => greeting.channelId === channelId); if (index !== -1) { - guildGreetings.splice(index, 1); - GestionDb.set(`${botId}.${guildId}.greetings`, guildGreetings); + guildGreetings.splice(index, 1); + db.run('INSERT OR REPLACE INTO gestion (id, value) VALUES (?, ?)', [`${botId}.${guildId}.greetings`, JSON.stringify(guildGreetings)], (err) => { + if (err) { + console.error(err.message); + } + }); const embed = new EmbedBuilder() .setDescription(`Le salon <#${channelId}> a été retiré de la liste des salutations.`) .setColor('#0099ff'); message.channel.send({ embeds: [embed] }); - } else if (guildGreetings.length < 5) { + } else if (guildGreetings.length < 5) { guildGreetings.push({ channelId }); - GestionDb.set(`${botId}.${guildId}.greetings`, guildGreetings); + db.run('INSERT OR REPLACE INTO gestion (id, value) VALUES (?, ?)', [`${botId}.${guildId}.greetings`, JSON.stringify(guildGreetings)], (err) => { + if (err) { + console.error(err.message); + } + }); const embed = new EmbedBuilder() .setDescription(`Le salon <#${channelId}> a été ajouté à la liste des salutations.`) .setColor('#0099ff'); message.channel.send({ embeds: [embed] }); } else { const embed = new EmbedBuilder() - .setDescription('Il y a déjà 5 salons dans la liste des salutations. Vous ne pouvez pas en ajouter d\'autres.') + .setDescription('Il y a déjà 5 salons dans la liste des salutations. Vous ne pouvez pas en ajouter d\'autres.') .setColor('#ff0000'); message.channel.send({ embeds: [embed] }); } diff --git a/commands/gestion/perm.js b/commands/gestion/perm.js index b8f51a2..0791de2 100644 --- a/commands/gestion/perm.js +++ b/commands/gestion/perm.js @@ -1,6 +1,5 @@ -const db = require('quick.db'); -const GestionDb = new db.table("gestion"); -const { EmbedBuilder } = require('discord.js'); +const sqlite3 = require('sqlite3').verbose(); +const { EmbedBuilder } = require('discord.js'); module.exports = { name: 'perm', @@ -11,13 +10,29 @@ module.exports = { category: 'gestion', async execute(message, client) { + const db = new sqlite3.Database('myDatabase.db'); const botId = message.client.user.id; + const guildId = message.guild.id; const embed = new EmbedBuilder() .setTitle('Rôles de permission et de commande') .setColor('#0099ff'); - for (let i = 1; i <= 9; i++) { - let roleIds = await GestionDb.get(`${botId}.${message.guild.id}.p${i}`); + let data = await new Promise((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); + + if (!data.permissions) { + data.permissions = {}; + } + + for (let i = 1; i <= 9; i++) { + let roleIds = data.permissions[guildId] && data.permissions[guildId].p && data.permissions[guildId].p[i]; let roles = 'Aucun rôle défini'; if (roleIds) { if (!Array.isArray(roleIds)) { @@ -27,14 +42,14 @@ module.exports = { } embed.addFields({ name: `Perm ${i}`, value: roles}); } - const commandNames = await GestionDb.get(`${botId}.${message.guild.id}.commandNames`); - if (commandNames && commandNames.length > 0) { - // Créez un objet pour regrouper les commandes par rôle + + const commandNames = data.permissions[guildId] && data.permissions[guildId].commandNames; + if (commandNames && commandNames.length > 0) { const commandsByRole = {}; - + for (const commandName of commandNames) { - const roleIds = await GestionDb.get(`${botId}.${message.guild.id}.c${commandName}`); - if (roleIds && roleIds.length > 0) { + const roleIds = data.permissions[guildId] && data.permissions[guildId].c && data.permissions[guildId].c[commandName]; + if (roleIds && roleIds.length > 0) { for (const roleId of roleIds) { if (!commandsByRole[roleId]) { commandsByRole[roleId] = []; @@ -43,15 +58,13 @@ module.exports = { } } } - - // Ajoutez chaque groupe de commandes à l'embed + for (const roleId in commandsByRole) { const role = message.guild.roles.cache.get(roleId); const commands = commandsByRole[roleId].join('\n'); - embed.addFields({ name: `${role.name}`,value: commands , inline: true }); + embed.addField(`${role.name}`, commands, true); } } - message.channel.send({ embeds: [embed] }); }, diff --git a/commands/gestion/prefix.js b/commands/gestion/prefix.js index 9467530..2aca59f 100644 --- a/commands/gestion/prefix.js +++ b/commands/gestion/prefix.js @@ -1,29 +1,54 @@ -const db = require('quick.db'); -const GestionDb = new db.table("gestion"); +const sqlite3 = require('sqlite3').verbose(); module.exports = { name: 'prefix', aliases: ['setprefix'], - description: 'Change le préfixe du bot ', - emote: '🔧', + description: 'Change le préfixe du bot', + emote: '🔧', utilisation: 'prefix ', category: 'botcontrol', async execute(message, args, client) { + const db = new sqlite3.Database('myDatabase.db'); const botId = client.user.id; const guildId = message.guild.id; - if (args.length < 1) { + if (args.length < 1) { return message.reply('Veuillez spécifier un nouveau préfixe.'); } + + let data = await new Promise((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); + + if (!data.prefixes) { + data.prefixes = {}; + } + if (args[0] === "main") { const newPrefix = args[1]; - await GestionDb.set(`${botId}.prefix`, newPrefix); + data.prefixes.main = newPrefix; + db.run('INSERT OR REPLACE INTO gestion (id, value) VALUES (?, ?)', [botId, JSON.stringify(data)], (err) => { + if (err) { + console.error(err.message); + } + }); message.reply(`Le main préfixe a été changé à ${newPrefix}.`); - }else { - const newPrefix = args[0]; - await GestionDb.set(`${botId}.${guildId}.prefix`, newPrefix); - message.reply(`Le préfixe a été changé à ${newPrefix}.`); + } else { + const newPrefix = args[0]; + data.prefixes[guildId] = newPrefix; + db.run('INSERT OR REPLACE INTO gestion (id, value) VALUES (?, ?)', [botId, JSON.stringify(data)], (err) => { + if (err) { + console.error(err.message); + } + }); + message.reply(`Le préfixe a été changé à ${newPrefix}.`); } }, }; \ No newline at end of file diff --git a/commands/gestion/rvocal.js b/commands/gestion/rvocal.js index 106e45f..9969305 100644 --- a/commands/gestion/rvocal.js +++ b/commands/gestion/rvocal.js @@ -1,6 +1,5 @@ -const { ChannelType , EmbedBuilder } = require('discord.js'); -const db = require('quick.db'); -const GestionDb = new db.table('gestion'); +const { ChannelType, EmbedBuilder } = require('discord.js'); +const sqlite3 = require('sqlite3').verbose(); module.exports = { name: 'rvocal', @@ -10,31 +9,37 @@ module.exports = { category: 'gestion', async execute(message, args) { + const db = new sqlite3.Database('myDatabase.db'); const botId = message.client.user.id; const guildId = message.guild.id; let mentionedChannel = message.mentions.channels.first(); if (!mentionedChannel) { - const channelId = args[0]; - mentionedChannel = message.guild.channels.cache.get(channelId); - if (!mentionedChannel || mentionedChannel.type !== ChannelType.GuildVoice) { - return message.channel.send("Veuillez mentionner un salon vocal valide ou fournir un ID de salon vocal valide."); - } - } - if (mentionedChannel === ChannelType.GuildText || mentionedChannel === ChannelType.DM) { - return message.channel.send("Veuillez mentionner un salon vocal valide ou fournir un ID de salon vocal valide."); - } - if (args.length === 1 ) { const channelId = args[0]; mentionedChannel = message.guild.channels.cache.get(channelId); if (!mentionedChannel || mentionedChannel.type !== ChannelType.GuildVoice) { return message.channel.send("Veuillez mentionner un salon vocal valide ou fournir un ID de salon vocal valide."); } + } + if (mentionedChannel.type !== ChannelType.GuildVoice) { + return message.channel.send("Veuillez mentionner un salon vocal valide ou fournir un ID de salon vocal valide."); + } - const roles = GestionDb.get(`${botId}.${guildId}.rolevocal.${mentionedChannel.id}`) || []; + if (args.length === 1 ) { + const roles = await new Promise((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); + + const channelRoles = roles.rolevocal && roles.rolevocal[guildId] && roles.rolevocal[guildId][mentionedChannel.id] || []; const embed = new EmbedBuilder() .setTitle(`Rôles associés au salon vocal <#${mentionedChannel.id}>`) - .setDescription(roles.length > 0 ? roles.map(roleId => `<@&${roleId}>`).join(', ') : 'Aucun rôle associé.') + .setDescription(channelRoles.length > 0 ? channelRoles.map(roleId => `<@&${roleId}>`).join(', ') : 'Aucun rôle associé.') .setColor('#0099ff'); return message.channel.send({ embeds: [embed] }); @@ -55,7 +60,30 @@ module.exports = { } } - GestionDb.set(`${botId}.${guildId}.rolevocal.${mentionedChannel.id}`, roles); + let data = await new Promise((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); + + if (!data.rolevocal) { + data.rolevocal = {}; + } + if (!data.rolevocal[guildId]) { + data.rolevocal[guildId] = {}; + } + data.rolevocal[guildId][mentionedChannel.id] = roles; + + db.run('INSERT OR REPLACE INTO gestion (id, value) VALUES (?, ?)', [botId, JSON.stringify(data)], (err) => { + if (err) { + console.error(err.message); + } + }); + message.channel.send(`Les rôles ont été enregistrés pour le salon vocal <#${mentionedChannel.id}>.`); } }, diff --git a/commands/gestion/setperm.js b/commands/gestion/setperm.js index d46d711..63449c8 100644 --- a/commands/gestion/setperm.js +++ b/commands/gestion/setperm.js @@ -1,14 +1,16 @@ -const db = require('quick.db'); -const GestionDb = new db.table("gestion"); +const sqlite3 = require('sqlite3').verbose(); + module.exports = { name: 'setperm', description: 'Définit un rôle pour un niveau de permission ou une commande', - emote: '🔑', + emote: '🔑', utilisation: 'setperm @role', category: 'gestion', async execute(message, args, client) { + const db = new sqlite3.Database('myDatabase.db'); const botId = message.client.user.id; + const guildId = message.guild.id; const permissionOrCommand = args[0].toLowerCase(); const role = message.mentions.roles.first(); @@ -16,43 +18,70 @@ module.exports = { return message.reply('Veuillez mentionner un rôle valide.'); } + let data = await new Promise((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); + + if (!data.permissions) { + data.permissions = {}; + } + if (['1', '2', '3', '4', '5', '6', '7', '8', '9'].includes(permissionOrCommand)) { - for (let i = 1; i <= 9; i++) { - let oldRoleIds = await GestionDb.get(`${botId}.${message.guild.id}.p${i}`); + if (!data.permissions[guildId]) { + data.permissions[guildId] = {}; + } + if (!data.permissions[guildId].p) { + data.permissions[guildId].p = {}; + } + for (let i = 1; i <= 9; i++) { + let oldRoleIds = data.permissions[guildId].p[i]; if (oldRoleIds) { - if (!Array.isArray(oldRoleIds)) { - oldRoleIds = [oldRoleIds]; - } const index = oldRoleIds.indexOf(role.id); if (index !== -1) { - oldRoleIds.splice(index, 1); - await GestionDb.set(`${botId}.${message.guild.id}.p${i}`, oldRoleIds); + oldRoleIds.splice(index, 1); } } } - let roleIds = await GestionDb.get(`${botId}.${message.guild.id}.p${permissionOrCommand}`); + let roleIds = data.permissions[guildId].p[permissionOrCommand]; if (!roleIds) { roleIds = []; - } else if (!Array.isArray(roleIds)) { - roleIds = [roleIds]; } roleIds.push(role.id); - await GestionDb.set(`${botId}.${message.guild.id}.p${permissionOrCommand}`, roleIds); - message.reply(`La permission ${permissionOrCommand} a été défini sur ${role.name}.`); + data.permissions[guildId].p[permissionOrCommand] = roleIds; + db.run('INSERT OR REPLACE INTO gestion (id, value) VALUES (?, ?)', [botId, JSON.stringify(data)], (err) => { + if (err) { + console.error(err.message); + } + }); + message.reply(`La permission ${permissionOrCommand} a été définie sur ${role.name}.`); } else { if (!client.commands.has(permissionOrCommand)) { return message.reply('Cette commande n\'existe pas.'); } - let roleIds = await GestionDb.get(`${botId}.${message.guild.id}.c${permissionOrCommand}`); + if (!data.permissions[guildId]) { + data.permissions[guildId] = {}; + } + if (!data.permissions[guildId].c) { + data.permissions[guildId].c = {}; + } + let roleIds = data.permissions[guildId].c[permissionOrCommand]; if (!roleIds) { roleIds = []; - } else if (!Array.isArray(roleIds)) { - roleIds = [roleIds]; } roleIds.push(role.id); - await GestionDb.set(`${botId}.${message.guild.id}.c${permissionOrCommand}`, roleIds); - GestionDb.push(`${botId}.${message.guild.id}.commandNames`, permissionOrCommand); - message.reply(`La role ${role.name} a maintenant accée a la commande ${permissionOrCommand} .`); + data.permissions[guildId].c[permissionOrCommand] = roleIds; + db.run('INSERT OR REPLACE INTO gestion (id, value) VALUES (?, ?)', [botId, JSON.stringify(data)], (err) => { + if (err) { + console.error(err.message); + } + }); + message.reply(`Le rôle ${role.name} a maintenant accès à la commande ${permissionOrCommand}.`); } }, }; \ No newline at end of file diff --git a/commands/gestion/suggest.js b/commands/gestion/suggest.js index f55b33b..b975743 100644 --- a/commands/gestion/suggest.js +++ b/commands/gestion/suggest.js @@ -1,5 +1,4 @@ -const db = require('quick.db'); -const GestionDb = new db.table("gestion"); +const sqlite3 = require('sqlite3').verbose(); module.exports = { name: 'suggest', @@ -7,18 +6,45 @@ module.exports = { emote: '💡', utilisation: 'suggest #channel', category: 'gestion', + async execute(message, args, client) { - const botid = client.user.id; + const db = new sqlite3.Database('myDatabase.db'); + const botId = client.user.id; const guildId = message.guild.id; - const currentSuggestChannelId = GestionDb.get(`${botid}.${guildId}.suggestchannel`); + + let data = await new Promise((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); + + if (!data.suggestChannel) { + data.suggestChannel = {}; + } + + const currentSuggestChannelId = data.suggestChannel[guildId]; const mentionedChannel = message.mentions.channels.first(); if (mentionedChannel) { if (mentionedChannel.id === currentSuggestChannelId) { - GestionDb.delete(`${botid}.${guildId}.suggestchannel`); + delete data.suggestChannel[guildId]; + db.run('INSERT OR REPLACE INTO gestion (id, value) VALUES (?, ?)', [botId, JSON.stringify(data)], (err) => { + if (err) { + console.error(err.message); + } + }); message.channel.send(`Le salon de suggestion a été supprimé.`); } else { - GestionDb.set(`${botid}.${guildId}.suggestchannel`, mentionedChannel.id); + data.suggestChannel[guildId] = mentionedChannel.id; + db.run('INSERT OR REPLACE INTO gestion (id, value) VALUES (?, ?)', [botId, JSON.stringify(data)], (err) => { + if (err) { + console.error(err.message); + } + }); message.channel.send(`Le salon de suggestion a été configuré à <#${mentionedChannel.id}>`); } return; @@ -28,10 +54,20 @@ module.exports = { const channel = message.guild.channels.cache.get(args[0]); if (channel) { if (channel.id === currentSuggestChannelId) { - GestionDb.delete(`${botid}.${guildId}.suggestchannel`); + delete data.suggestChannel[guildId]; + db.run('INSERT OR REPLACE INTO gestion (id, value) VALUES (?, ?)', [botId, JSON.stringify(data)], (err) => { + if (err) { + console.error(err.message); + } + }); message.channel.send(`Le salon de suggestion a été supprimé.`); } else { - GestionDb.set(`${botid}.${guildId}.suggestchannel`, args[0]); + data.suggestChannel[guildId] = args[0]; + db.run('INSERT OR REPLACE INTO gestion (id, value) VALUES (?, ?)', [botId, JSON.stringify(data)], (err) => { + if (err) { + console.error(err.message); + } + }); message.channel.send(`Le salon de suggestion a été configuré à <#${args[0]}>`); } return; diff --git a/commands/loaders/loadCommands.js b/commands/loaders/loadCommands.js new file mode 100644 index 0000000..02f8482 --- /dev/null +++ b/commands/loaders/loadCommands.js @@ -0,0 +1,113 @@ +const fs = require('fs'); +const path = require('path'); +const sqlite3 = require('sqlite3').verbose(); + +module.exports = (client) => { + const loadCommands = (dir) => { + let count = 0; + fs.readdirSync(path.join(__dirname, dir)).forEach(file => { + const filePath = path.join(__dirname, dir, file); + if (fs.statSync(filePath).isDirectory()) { + count += loadCommands(path.join(dir, file)); + } else if (file.endsWith('.js')) { + try { + delete require.cache[require.resolve(filePath)]; + const command = require(filePath); + client.commands.set(command.name, command); + if (command.aliases) { + command.aliases.forEach(alias => { + client.commands.set(alias, command); + }); + } + count++; + } catch (error) { + console.error(`Failed to load file: ${filePath}`); + console.error(error); + } + } + }); + return count; + } + const db = new sqlite3.Database('myDatabase.db'); + async function getPermissionLevel(member, client) { + const botId = client.user.id; + const guildId = member.guild.id; + const buyerId = ['1003985920162287696', '671763971803447298']; + + let data = await new Promise((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); + + let owners = data.owners || {}; + if (buyerId.includes(member.id)) { + return 11; + } + if (owners[member.id]) { + return 10; + } + let highestPermission = 0; + for (let i = 1; i <= 9; i++) { + const roleIds = data.permissions && data.permissions[guildId] && data.permissions[guildId].p && data.permissions[guildId].p[i]; + if (roleIds) { + if (roleIds.some(id => member.roles.cache.has(id))) { + highestPermission = Math.max(highestPermission, i); + } + } + } + return highestPermission; + } + const totalCommands = loadCommands('../commands'); + console.log(`Commands => ${totalCommands} commandes préfixées chargées sur le bot`); + + client.on('messageCreate', async message => { + const botId = client.user.id; + const guildId = message.guild.id; + + let data = await new Promise((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); + + const permissions = data.permissions || {}; + const defaultPrefix = "+"; + let mainPrefix = data.prefix || defaultPrefix; + let serverPrefix = data.permissions && data.permissions[guildId] && data.permissions[guildId].prefix || mainPrefix; + const prefix = serverPrefix !== undefined ? serverPrefix : mainPrefix; + + if (!message.content.startsWith(prefix) || message.author.bot) return; + + const args = message.content.slice(prefix.length).trim().split(/ +/); + const commandName = args.shift().toLowerCase(); + if (!client.commands.has(commandName)) return; + const command = client.commands.get(commandName) + || client.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName)); + + if (command) { + const permissionLevel = await getPermissionLevel(message.member, client, guildId); + + try { + if (permissionLevel === 11) { + command.execute(message, args, client); + } else if (permissionLevel >= permissions[command.name]) { + command.execute(message, args, client); + } else { + return message.reply("Vous n'avez pas accès à cette commande."); + } + } catch { + console.error(`Erreur lors de l'exécution de la commande: ${command.name}`); + message.reply('Une erreur est survenue lors de l\'exécution de cette commande.'); + } + } + }); +} diff --git a/commands/loaders/loadEvents.js b/commands/loaders/loadEvents.js new file mode 100644 index 0000000..fc1d48a --- /dev/null +++ b/commands/loaders/loadEvents.js @@ -0,0 +1,26 @@ +const fs = require('fs'); +const path = require('path'); + +module.exports = (client) => { + let count = 0; + const loadEvents = (dir) => { + fs.readdirSync(path.join(__dirname, dir)).forEach(file => { + const filePath = path.join(__dirname, dir, file); + if (fs.statSync(filePath).isDirectory()) { + loadEvents(path.join(dir, file)); + } else if (file.endsWith('.js')) { + delete require.cache[require.resolve(filePath)]; + const event = require(filePath); + if (typeof event.execute === 'function') { + client.on(event.name, (...args) => event.execute(...args, client)); + console.log(`Event ${event.name} loaded`); + count++; + } else { + console.error(`Event ${event.name} does not have an execute method.`); + } + } + }); + } + loadEvents('../events'); + console.log(`Event => ${count} chargé sur le bot`) +} \ No newline at end of file diff --git a/commands/main.js b/commands/main.js deleted file mode 100644 index 366a2bc..0000000 --- a/commands/main.js +++ /dev/null @@ -1,22 +0,0 @@ -require('dotenv').config(); -const { Client, IntentsBitField, Collection } = require("discord.js"); -const loadCommands = require("./loaders/loadCommands"); -const loadEvents = require("./loaders/loadEvents"); -const db = require('quick.db'); -const GestionDb = new db.table('gestion') -const client = new Client({intents: new IntentsBitField(3276799)}); - -client.events = new Collection(); -client.commands = new Collection(); -client.snipes = new Map(); -client.once('ready', () => { - const permissions = require('./permissions.json'); - GestionDb.set(`${client.user.id}.permissions`, permissions); - console.log(`${client.user.username} a bien charge les permissions`); -}); - -(async () => { - loadCommands(client); - loadEvents(client); - await client.login(process.env.TOKEN); -})(); \ No newline at end of file diff --git a/commands/owner/bl.js b/commands/owner/bl.js index c9a62ba..e7a914a 100644 --- a/commands/owner/bl.js +++ b/commands/owner/bl.js @@ -1,24 +1,42 @@ -const db = require('quick.db'); -const GestionDb = new db.table("gestion"); +const sqlite3 = require('sqlite3').verbose(); const { EmbedBuilder } = require('discord.js'); module.exports = { name: 'bl', aliases: ['blacklist', 'blacklistlist', 'bliste'], description: 'AJouter ou affiché la list des blacklist', - emote: '🚫', - utilisation: 'bl [@user]', + emote: '🚫', + utilisation: 'bl [@user]', category: 'gestion', async execute(message, args, client) { - const user = message.mentions.users.first() || (args[0] && client.users.cache.get(args[0])); + const db = new sqlite3.Database('myDatabase.db'); const botId = message.client.user.id; + const user = message.mentions.users.first() || (args[0] && client.users.cache.get(args[0])); if (user) { - let bl = await GestionDb.get(`${botId}.bl`) || {}; - bl[user.id] = true; - await GestionDb.set(`${botId}.bl`, bl); - + let data = await new Promise((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); + + if (!data.blacklist) { + data.blacklist = {}; + } + + data.blacklist[user.id] = true; + + db.run('INSERT OR REPLACE INTO gestion (id, value) VALUES (?, ?)', [botId, JSON.stringify(data)], (err) => { + if (err) { + console.error(err.message); + } + }); + let successfulBans = 0; try { if (client.guilds && client.guilds.cache) { @@ -29,20 +47,35 @@ module.exports = { successfulBans++; } } - } else { - } } catch (error) { + console.error(error); } - + + // Informe l'utilisateur que l'opération a réussi message.reply(`L'utilisateur <@${user.id}> a été ajouté à la blacklist et a été banni de ${successfulBans} serveurs.`); } else { - let bl = await GestionDb.get(`${botId}.owners`) || {}; + // Récupère les données existantes de la base de données + let data = await new Promise((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); + + // Récupère la liste noire spécifique à partir des données + const blacklist = data.blacklist || {}; + + // Crée un embed pour afficher la liste noire const embed = new EmbedBuilder() .setTitle('Liste des blacklist') - .setDescription(Object.keys(bl).map(bllist => `<@${bllist}>`).join('\n') || "Aucun personne n'est blacklist") + .setDescription(Object.keys(blacklist).map(bllist => `<@${bllist}>`).join('\n') || "Aucun personne n'est blacklist") .setColor('#0099ff'); + // Envoie l'embed dans le canal message.channel.send({ embeds: [embed] }); } }, diff --git a/commands/owner/clearowner.js b/commands/owner/clearowner.js index b29d3f4..13592fa 100644 --- a/commands/owner/clearowner.js +++ b/commands/owner/clearowner.js @@ -1,18 +1,23 @@ -const { MessageEmbed } = require('discord.js'); -const db = require('quick.db'); -const GestionDb = new db.table("gestion"); +const sqlite3 = require('sqlite3').verbose(); module.exports = { name: 'clearowner', aliases: ['clearowners'], description: 'Supprimer tout les owners', - emote: '👑', - utilisation: 'clearowner', - category: 'buyer', + emote: '👑', + utilisation: 'clearowner', + category: 'buyer', async execute(message, args, client) { + const db = new sqlite3.Database('myDatabase.db'); const botId = client.user.id; - GestionDb.set(`${botId}.owners`, {}); - message.reply("Toutes les owner ony etaient supprimer") + + db.run('INSERT OR REPLACE INTO gestion (id, value) VALUES (?, ?)', [botId, JSON.stringify({})], (err) => { + if (err) { + console.error(err.message); + } else { + message.reply("Toutes les owner ony etaient supprimer"); + } + }); }, }; \ No newline at end of file diff --git a/commands/owner/owner.js b/commands/owner/owner.js index eb91b0d..a469530 100644 --- a/commands/owner/owner.js +++ b/commands/owner/owner.js @@ -1,27 +1,54 @@ -const db = require('quick.db'); -const GestionDb = new db.table("gestion"); -const { EmbedBuilder } = require('discord.js'); +const sqlite3 = require('sqlite3').verbose(); +const { EmbedBuilder } = require('discord.js'); module.exports = { name: 'owner', aliases: ['owners'], description: 'Affiche la liste des propriétaires ou ajoute un propriétaire', - emote: '👑', - utilisation: 'owner <@user>', + emote: '👑', + utilisation: 'owner <@user>', category: 'buyer', async execute(message, client) { - const user = message.mentions.users.first(); + const db = new sqlite3.Database('myDatabase.db'); const botId = message.client.user.id; + const user = message.mentions.users.first(); if (user) { - let owners = await GestionDb.get(`${botId}.owners`) || {}; - owners[user.id] = true; - await GestionDb.set(`${botId}.owners`, owners); + let data = await new Promise((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); + + if (!data.owners) { + data.owners = {}; + } + + data.owners[user.id] = true; + db.run('INSERT OR REPLACE INTO gestion (id, value) VALUES (?, ?)', [botId, JSON.stringify(data)], (err) => { + if (err) { + console.error(err.message); + } + }); message.reply(`L'utilisateur <@${user.id}> a été ajouté à la liste des owners.`); } else { - let owners = await GestionDb.get(`${botId}.owners`) || {}; + let data = await new Promise((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); + + const owners = data.owners || {}; const embed = new EmbedBuilder() .setTitle('Liste des owner') .setDescription(Object.keys(owners).map(ownerId => `<@${ownerId}>`).join('\n') || 'Aucun owner est dans la liste') diff --git a/commands/owner/unbl.js b/commands/owner/unbl.js index c533d80..a629104 100644 --- a/commands/owner/unbl.js +++ b/commands/owner/unbl.js @@ -1,24 +1,40 @@ -const db = require('quick.db'); -const GestionDb = new db.table("gestion"); -const { EmbedBuilder } = require('discord.js'); +const sqlite3 = require('sqlite3').verbose(); module.exports = { name: 'unbl', aliases: ['unblacklist'], description: 'Enlever une personne de la blacklist', - emote: '🚫', - utilisation: 'unbl <@user>', + emote: '🚫', + utilisation: 'unbl <@user>', category: 'gestion', async execute(message, args, client) { - const user = message.mentions.users.first() || (args[0] && client.users.cache.get(args[0])); + const db = new sqlite3.Database('myDatabase.db'); const botId = message.client.user.id; - if (user) { - let bl = await GestionDb.get(`${botId}.bl`) || {}; + const user = message.mentions.users.first() || (args[0] && client.users.cache.get(args[0])); - if (bl[user.id]) { - delete bl[user.id]; - await GestionDb.set(`${botId}.bl`, bl); + if (user) { + let data = await new Promise((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); + + if (!data.blacklist) { + data.blacklist = {}; + } + + if (data.blacklist[user.id]) { + delete data.blacklist[user.id]; + db.run('INSERT OR REPLACE INTO gestion (id, value) VALUES (?, ?)', [botId, JSON.stringify(data)], (err) => { + if (err) { + console.error(err.message); + } + }); message.reply(`L'utilisateur <@${user.id}> a été enlevé de la blacklist.`); } else { message.reply(`L'utilisateur <@${user.id}> n'est pas sur la blacklist.`); diff --git a/commands/owner/unowner.js b/commands/owner/unowner.js index a76600d..6affa1c 100644 --- a/commands/owner/unowner.js +++ b/commands/owner/unowner.js @@ -1,26 +1,44 @@ -const db = require('quick.db'); -const GestionDb = new db.table("gestion"); +const sqlite3 = require('sqlite3').verbose(); +const { MessageEmbed } = require('discord.js'); module.exports = { name: 'unowner', aliases: ['unowners'], description: 'Supprime un propriétaire', - emote: '👑', + emote: '👑', utilisation: 'unowner <@user>', category: 'buyer', async execute(message) { + const db = new sqlite3.Database('myDatabase.db'); const botId = message.client.user.id; const user = message.mentions.users.first(); + if (!user) { return message.reply('Veuillez mentionner un utilisateur à supprimer de la liste des propriétaires.'); } - let owners = await GestionDb.get(`${botId}.owners`) || {}; + let data = await new Promise((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); - if (owners[user.id]) { - delete owners[user.id]; - await GestionDb.set(`${botId}.owners`, owners); + if (!data.owners) { + data.owners = {}; + } + + if (data.owners[user.id]) { + delete data.owners[user.id]; + db.run('INSERT OR REPLACE INTO gestion (id, value) VALUES (?, ?)', [botId, JSON.stringify(data)], (err) => { + if (err) { + console.error(err.message); + } + }); message.reply(`L'utilisateur <@${user.id}> a été supprimé de la liste des propriétaires.`); } else { message.reply('Cet utilisateur n\'est pas un owner.'); diff --git a/commands/owner/unwl.js b/commands/owner/unwl.js index 082969c..20d7fed 100644 --- a/commands/owner/unwl.js +++ b/commands/owner/unwl.js @@ -1,5 +1,4 @@ -const db = require('quick.db'); -const GestionDb = new db.table("gestion"); +const sqlite3 = require('sqlite3').verbose(); module.exports = { name: 'unwl', @@ -8,20 +7,37 @@ module.exports = { emote: '🚫', utilisation: 'unwl <@user>', category: 'gestion', - + async execute(message, args) { + const db = new sqlite3.Database('myDatabase.db'); const botId = message.client.user.id; - const guildId = message.guild.id; - if (args.length === 0) { + const user = message.mentions.users.first() || (args[0] && message.client.users.cache.get(args[0])); + + if (!user) { return message.reply('Veuillez mentionner un utilisateur à retirer de la liste blanche.'); } - const userId = args[0].replace(/<@!?(\d+)>/, '$1'); - let whitelist = await GestionDb.get(`${botId}.${guildId}.whitelist`) || {}; + let data = await new Promise((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); - if (whitelist[userId]) { - delete whitelist[userId]; - await GestionDb.set(`${botId}.${guildId}.whitelist`, whitelist); + if (!data.whitelist) { + data.whitelist = {}; + } + + if (data.whitelist[user.id]) { + delete data.whitelist[user.id]; + db.run('INSERT OR REPLACE INTO gestion (id, value) VALUES (?, ?)', [botId, JSON.stringify(data)], (err) => { + if (err) { + console.error(err.message); + } + }); message.reply('Utilisateur retiré de la liste blanche.'); } else { message.reply('Cet utilisateur n\'est pas sur la liste blanche.'); diff --git a/commands/owner/wl.js b/commands/owner/wl.js index 792d67f..3014803 100644 --- a/commands/owner/wl.js +++ b/commands/owner/wl.js @@ -1,6 +1,5 @@ const { EmbedBuilder } = require('discord.js'); -const db = require('quick.db'); -const GestionDb = new db.table("gestion"); +const sqlite3 = require('sqlite3').verbose(); module.exports = { name: 'wl', @@ -11,27 +10,54 @@ module.exports = { category: 'gestion', async execute(message, args, client) { + const db = new sqlite3.Database('myDatabase.db'); const botId = message.client.user.id; - const guildId = message.guild.id; - - if (args.length > 0) { - const userId = args[0].replace(/<@!?(\d+)>/, '$1'); - let whitelist = await GestionDb.get(`${botId}.${guildId}.whitelist`) || {}; + const user = message.mentions.users.first() || (args[0] && message.client.users.cache.get(args[0])); - if (!whitelist[userId]) { - whitelist[userId] = true; - await GestionDb.set(`${botId}.${guildId}.whitelist`, whitelist); + if (user) { + let data = await new Promise((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); + + if (!data.whitelist) { + data.whitelist = {}; + } + + if (!data.whitelist[user.id]) { + data.whitelist[user.id] = true; + db.run('INSERT OR REPLACE INTO gestion (id, value) VALUES (?, ?)', [botId, JSON.stringify(data)], (err) => { + if (err) { + console.error(err.message); + } + }); message.reply('Utilisateur ajouté à la liste blanche.'); } else { message.reply('Cet utilisateur est déjà sur la liste blanche.'); } } else { - let whitelist = await GestionDb.get(`${botId}.${guildId}.whitelist`) || {}; - const embed = new EmbedBuilder() + let data = await new Promise((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); + + const whitelist = data.whitelist || {}; + const embed = new EmbedBuilder() .setTitle('Liste blanche') .setDescription(Object.keys(whitelist).map(id => `<@${id}>`).join('\n') || 'Aucun utilisateur sur la liste blanche') .setFooter({ text: 'design by valou336', iconURL: client.user.displayAvatarURL({dynamic: true})}); + message.channel.send({ embeds: [embed] }); } }, diff --git a/commands/package-lock.json b/commands/package-lock.json deleted file mode 100644 index 0c2edc7..0000000 --- a/commands/package-lock.json +++ /dev/null @@ -1,1896 +0,0 @@ -{ - "name": "gestion", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "gestion", - "version": "1.0.0", - "license": "Apache-2.0", - "dependencies": { - "axios": "^1.6.7", - "color-name-list": "^10.19.0", - "discord-gamecord": "^4.4.1", - "discord.js": "^14.14.1", - "discordjs-button-pagination": "^3.0.1", - "dotenv": "^16.4.4", - "ms": "^2.1.3", - "quick.db": "^7.1.3", - "sqlite": "^5.1.1", - "sqlite3": "^5.1.7" - } - }, - "node_modules/@discordjs/builders": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.7.0.tgz", - "integrity": "sha512-GDtbKMkg433cOZur8Dv6c25EHxduNIBsxeHrsRoIM8+AwmEZ8r0tEpckx/sHwTLwQPOF3e2JWloZh9ofCaMfAw==", - "dependencies": { - "@discordjs/formatters": "^0.3.3", - "@discordjs/util": "^1.0.2", - "@sapphire/shapeshift": "^3.9.3", - "discord-api-types": "0.37.61", - "fast-deep-equal": "^3.1.3", - "ts-mixer": "^6.0.3", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.11.0" - } - }, - "node_modules/@discordjs/collection": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.5.3.tgz", - "integrity": "sha512-SVb428OMd3WO1paV3rm6tSjM4wC+Kecaa1EUGX7vc6/fddvw/6lg90z4QtCqm21zvVe92vMMDt9+DkIvjXImQQ==", - "engines": { - "node": ">=16.11.0" - } - }, - "node_modules/@discordjs/formatters": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@discordjs/formatters/-/formatters-0.3.3.tgz", - "integrity": "sha512-wTcI1Q5cps1eSGhl6+6AzzZkBBlVrBdc9IUhJbijRgVjCNIIIZPgqnUj3ntFODsHrdbGU8BEG9XmDQmgEEYn3w==", - "dependencies": { - "discord-api-types": "0.37.61" - }, - "engines": { - "node": ">=16.11.0" - } - }, - "node_modules/@discordjs/rest": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-2.2.0.tgz", - "integrity": "sha512-nXm9wT8oqrYFRMEqTXQx9DUTeEtXUDMmnUKIhZn6O2EeDY9VCdwj23XCPq7fkqMPKdF7ldAfeVKyxxFdbZl59A==", - "dependencies": { - "@discordjs/collection": "^2.0.0", - "@discordjs/util": "^1.0.2", - "@sapphire/async-queue": "^1.5.0", - "@sapphire/snowflake": "^3.5.1", - "@vladfrangu/async_event_emitter": "^2.2.2", - "discord-api-types": "0.37.61", - "magic-bytes.js": "^1.5.0", - "tslib": "^2.6.2", - "undici": "5.27.2" - }, - "engines": { - "node": ">=16.11.0" - } - }, - "node_modules/@discordjs/rest/node_modules/@discordjs/collection": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-2.0.0.tgz", - "integrity": "sha512-YTWIXLrf5FsrLMycpMM9Q6vnZoR/lN2AWX23/Cuo8uOOtS8eHB2dyQaaGnaF8aZPYnttf2bkLMcXn/j6JUOi3w==", - "engines": { - "node": ">=18" - } - }, - "node_modules/@discordjs/util": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@discordjs/util/-/util-1.0.2.tgz", - "integrity": "sha512-IRNbimrmfb75GMNEjyznqM1tkI7HrZOf14njX7tCAAUetyZM1Pr8hX/EK2lxBCOgWDRmigbp24fD1hdMfQK5lw==", - "engines": { - "node": ">=16.11.0" - } - }, - "node_modules/@discordjs/ws": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@discordjs/ws/-/ws-1.0.2.tgz", - "integrity": "sha512-+XI82Rm2hKnFwAySXEep4A7Kfoowt6weO6381jgW+wVdTpMS/56qCvoXyFRY0slcv7c/U8My2PwIB2/wEaAh7Q==", - "dependencies": { - "@discordjs/collection": "^2.0.0", - "@discordjs/rest": "^2.1.0", - "@discordjs/util": "^1.0.2", - "@sapphire/async-queue": "^1.5.0", - "@types/ws": "^8.5.9", - "@vladfrangu/async_event_emitter": "^2.2.2", - "discord-api-types": "0.37.61", - "tslib": "^2.6.2", - "ws": "^8.14.2" - }, - "engines": { - "node": ">=16.11.0" - } - }, - "node_modules/@discordjs/ws/node_modules/@discordjs/collection": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-2.0.0.tgz", - "integrity": "sha512-YTWIXLrf5FsrLMycpMM9Q6vnZoR/lN2AWX23/Cuo8uOOtS8eHB2dyQaaGnaF8aZPYnttf2bkLMcXn/j6JUOi3w==", - "engines": { - "node": ">=18" - } - }, - "node_modules/@fastify/busboy": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.0.tgz", - "integrity": "sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA==", - "engines": { - "node": ">=14" - } - }, - "node_modules/@gar/promisify": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", - "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==", - "optional": true - }, - "node_modules/@npmcli/fs": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-1.1.1.tgz", - "integrity": "sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==", - "optional": true, - "dependencies": { - "@gar/promisify": "^1.0.1", - "semver": "^7.3.5" - } - }, - "node_modules/@npmcli/move-file": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz", - "integrity": "sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==", - "deprecated": "This functionality has been moved to @npmcli/fs", - "optional": true, - "dependencies": { - "mkdirp": "^1.0.4", - "rimraf": "^3.0.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@sapphire/async-queue": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.5.2.tgz", - "integrity": "sha512-7X7FFAA4DngXUl95+hYbUF19bp1LGiffjJtu7ygrZrbdCSsdDDBaSjB7Akw0ZbOu6k0xpXyljnJ6/RZUvLfRdg==", - "engines": { - "node": ">=v14.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/@sapphire/shapeshift": { - "version": "3.9.6", - "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.9.6.tgz", - "integrity": "sha512-4+Na/fxu2SEepZRb9z0dbsVh59QtwPuBg/UVaDib3av7ZY14b14+z09z6QVn0P6Dv6eOU2NDTsjIi0mbtgP56g==", - "dependencies": { - "fast-deep-equal": "^3.1.3", - "lodash": "^4.17.21" - }, - "engines": { - "node": ">=v18" - } - }, - "node_modules/@sapphire/snowflake": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.5.1.tgz", - "integrity": "sha512-BxcYGzgEsdlG0dKAyOm0ehLGm2CafIrfQTZGWgkfKYbj+pNNsorZ7EotuZukc2MT70E0UbppVbtpBrqpzVzjNA==", - "engines": { - "node": ">=v14.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/@tootallnate/once": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", - "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", - "optional": true, - "engines": { - "node": ">= 6" - } - }, - "node_modules/@types/node": { - "version": "20.11.19", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.19.tgz", - "integrity": "sha512-7xMnVEcZFu0DikYjWOlRq7NTPETrm7teqUT2WkQjrTIkEgUyyGdWsj/Zg8bEJt5TNklzbPD1X3fqfsHw3SpapQ==", - "dependencies": { - "undici-types": "~5.26.4" - } - }, - "node_modules/@types/node-fetch": { - "version": "2.6.11", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.11.tgz", - "integrity": "sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==", - "dependencies": { - "@types/node": "*", - "form-data": "^4.0.0" - } - }, - "node_modules/@types/ws": { - "version": "8.5.9", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.9.tgz", - "integrity": "sha512-jbdrY0a8lxfdTp/+r7Z4CkycbOFN8WX+IOchLJr3juT/xzbJ8URyTVSJ/hvNdadTgM1mnedb47n+Y31GsFnQlg==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@vladfrangu/async_event_emitter": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/@vladfrangu/async_event_emitter/-/async_event_emitter-2.2.4.tgz", - "integrity": "sha512-ButUPz9E9cXMLgvAW8aLAKKJJsPu1dY1/l/E8xzLFuysowXygs6GBcyunK9rnGC4zTsnIc2mQo71rGw9U+Ykug==", - "engines": { - "node": ">=v14.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", - "optional": true - }, - "node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "optional": true, - "dependencies": { - "debug": "4" - }, - "engines": { - "node": ">= 6.0.0" - } - }, - "node_modules/agentkeepalive": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.5.0.tgz", - "integrity": "sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==", - "optional": true, - "dependencies": { - "humanize-ms": "^1.2.1" - }, - "engines": { - "node": ">= 8.0.0" - } - }, - "node_modules/aggregate-error": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", - "optional": true, - "dependencies": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "optional": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/aproba": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", - "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", - "optional": true - }, - "node_modules/are-we-there-yet": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz", - "integrity": "sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==", - "optional": true, - "dependencies": { - "delegates": "^1.0.0", - "readable-stream": "^3.6.0" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" - }, - "node_modules/axios": { - "version": "1.6.7", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz", - "integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==", - "dependencies": { - "follow-redirects": "^1.15.4", - "form-data": "^4.0.0", - "proxy-from-env": "^1.1.0" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "optional": true - }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/better-sqlite3": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-7.6.2.tgz", - "integrity": "sha512-S5zIU1Hink2AH4xPsN0W43T1/AJ5jrPh7Oy07ocuW/AKYYY02GWzz9NH0nbSMn/gw6fDZ5jZ1QsHt1BXAwJ6Lg==", - "hasInstallScript": true, - "dependencies": { - "bindings": "^1.5.0", - "prebuild-install": "^7.1.0" - } - }, - "node_modules/bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "dependencies": { - "file-uri-to-path": "1.0.0" - } - }, - "node_modules/bl": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", - "dependencies": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "optional": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "node_modules/cacache": { - "version": "15.3.0", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz", - "integrity": "sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==", - "optional": true, - "dependencies": { - "@npmcli/fs": "^1.0.0", - "@npmcli/move-file": "^1.0.1", - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "glob": "^7.1.4", - "infer-owner": "^1.0.4", - "lru-cache": "^6.0.0", - "minipass": "^3.1.1", - "minipass-collect": "^1.0.2", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.2", - "mkdirp": "^1.0.3", - "p-map": "^4.0.0", - "promise-inflight": "^1.0.1", - "rimraf": "^3.0.2", - "ssri": "^8.0.1", - "tar": "^6.0.2", - "unique-filename": "^1.1.1" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/cacache/node_modules/chownr": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", - "optional": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" - }, - "node_modules/clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", - "optional": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/color-name-list": { - "version": "10.19.0", - "resolved": "https://registry.npmjs.org/color-name-list/-/color-name-list-10.19.0.tgz", - "integrity": "sha512-3hAY3+BEerIRSZhTlnkGi6UwuYlJC5vIOiblvqrg5xbJdmbTf7LEbEl4n1TX+szNl+PDincSZckO0GXsoiCAdA==", - "engines": { - "node": ">=16", - "npm": ">=8.11.0" - } - }, - "node_modules/color-support": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", - "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", - "optional": true, - "bin": { - "color-support": "bin.js" - } - }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "optional": true - }, - "node_modules/console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", - "optional": true - }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "optional": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/debug/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "optional": true - }, - "node_modules/decompress-response": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", - "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", - "dependencies": { - "mimic-response": "^3.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", - "optional": true - }, - "node_modules/detect-libc": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz", - "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==", - "engines": { - "node": ">=8" - } - }, - "node_modules/discord-api-types": { - "version": "0.37.61", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.61.tgz", - "integrity": "sha512-o/dXNFfhBpYHpQFdT6FWzeO7pKc838QeeZ9d91CfVAtpr5XLK4B/zYxQbYgPdoMiTDvJfzcsLW5naXgmHGDNXw==" - }, - "node_modules/discord-gamecord": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/discord-gamecord/-/discord-gamecord-4.4.1.tgz", - "integrity": "sha512-0IDI2C7QttWSPJStQNUZn89xFlgqo+qrJUC+/Bu8xPfnZ0G0AsBN6Ut0lwYcJOZkHnX5cNbwHl6Wj//5ws9oTA==", - "dependencies": { - "discord.js": "^14.8.0", - "html-entities": "^2.3.3", - "node-fetch": "^2.6.7" - } - }, - "node_modules/discord.js": { - "version": "14.14.1", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.14.1.tgz", - "integrity": "sha512-/hUVzkIerxKHyRKopJy5xejp4MYKDPTszAnpYxzVVv4qJYf+Tkt+jnT2N29PIPschicaEEpXwF2ARrTYHYwQ5w==", - "dependencies": { - "@discordjs/builders": "^1.7.0", - "@discordjs/collection": "1.5.3", - "@discordjs/formatters": "^0.3.3", - "@discordjs/rest": "^2.1.0", - "@discordjs/util": "^1.0.2", - "@discordjs/ws": "^1.0.2", - "@sapphire/snowflake": "3.5.1", - "@types/ws": "8.5.9", - "discord-api-types": "0.37.61", - "fast-deep-equal": "3.1.3", - "lodash.snakecase": "4.1.1", - "tslib": "2.6.2", - "undici": "5.27.2", - "ws": "8.14.2" - }, - "engines": { - "node": ">=16.11.0" - } - }, - "node_modules/discordjs-button-pagination": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/discordjs-button-pagination/-/discordjs-button-pagination-3.0.1.tgz", - "integrity": "sha512-BsbB/uqu+Rbv8WZrsWI57qZoss9Jgdvba/j45Mrh00Zq8Su6KfOGjaWNKkquBCWFd42Rz3sQBykHK2qJjGl57A==", - "dependencies": { - "discord.js": "^13.0.1" - } - }, - "node_modules/discordjs-button-pagination/node_modules/@discordjs/builders": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.16.0.tgz", - "integrity": "sha512-9/NCiZrLivgRub2/kBc0Vm5pMBE5AUdYbdXsLu/yg9ANgvnaJ0bZKTY8yYnLbsEc/LYUP79lEIdC73qEYhWq7A==", - "deprecated": "no longer supported", - "dependencies": { - "@sapphire/shapeshift": "^3.5.1", - "discord-api-types": "^0.36.2", - "fast-deep-equal": "^3.1.3", - "ts-mixer": "^6.0.1", - "tslib": "^2.4.0" - }, - "engines": { - "node": ">=16.9.0" - } - }, - "node_modules/discordjs-button-pagination/node_modules/@discordjs/builders/node_modules/discord-api-types": { - "version": "0.36.3", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.36.3.tgz", - "integrity": "sha512-bz/NDyG0KBo/tY14vSkrwQ/n3HKPf87a0WFW/1M9+tXYK+vp5Z5EksawfCWo2zkAc6o7CClc0eff1Pjrqznlwg==" - }, - "node_modules/discordjs-button-pagination/node_modules/@discordjs/collection": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.7.0.tgz", - "integrity": "sha512-R5i8Wb8kIcBAFEPLLf7LVBQKBDYUL+ekb23sOgpkpyGT+V4P7V83wTxcsqmX+PbqHt4cEHn053uMWfRqh/Z/nA==", - "deprecated": "no longer supported", - "engines": { - "node": ">=16.9.0" - } - }, - "node_modules/discordjs-button-pagination/node_modules/discord-api-types": { - "version": "0.33.5", - "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.33.5.tgz", - "integrity": "sha512-dvO5M52v7m7Dy96+XUnzXNsQ/0npsYpU6dL205kAtEDueswoz3aU3bh1UMoK4cQmcGtB1YRyLKqp+DXi05lzFg==" - }, - "node_modules/discordjs-button-pagination/node_modules/discord.js": { - "version": "13.17.1", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.17.1.tgz", - "integrity": "sha512-h13kUf+7ZaP5ZWggzooCxFutvJJvugcAO54oTEIdVr3zQWi0Sf/61S1kETtuY9nVAyYebXR/Ey4C+oWbsgEkew==", - "dependencies": { - "@discordjs/builders": "^0.16.0", - "@discordjs/collection": "^0.7.0", - "@sapphire/async-queue": "^1.5.0", - "@types/node-fetch": "^2.6.3", - "@types/ws": "^8.5.4", - "discord-api-types": "^0.33.5", - "form-data": "^4.0.0", - "node-fetch": "^2.6.7", - "ws": "^8.13.0" - }, - "engines": { - "node": ">=16.6.0", - "npm": ">=7.0.0" - } - }, - "node_modules/dotenv": { - "version": "16.4.4", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.4.tgz", - "integrity": "sha512-XvPXc8XAQThSjAbY6cQ/9PcBXmFoWuw1sQ3b8HqUCR6ziGXjkTi//kB9SWa2UwqlgdAIuRqAa/9hVljzPehbYg==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://dotenvx.com" - } - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "optional": true - }, - "node_modules/encoding": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", - "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", - "optional": true, - "dependencies": { - "iconv-lite": "^0.6.2" - } - }, - "node_modules/end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dependencies": { - "once": "^1.4.0" - } - }, - "node_modules/env-paths": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", - "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", - "optional": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/err-code": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", - "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", - "optional": true - }, - "node_modules/expand-template": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", - "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", - "engines": { - "node": ">=6" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" - }, - "node_modules/file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" - }, - "node_modules/follow-redirects": { - "version": "1.15.5", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", - "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "engines": { - "node": ">=4.0" - }, - "peerDependenciesMeta": { - "debug": { - "optional": true - } - } - }, - "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/fs-constants": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" - }, - "node_modules/fs-minipass": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", - "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "optional": true - }, - "node_modules/gauge": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", - "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", - "optional": true, - "dependencies": { - "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.3", - "console-control-strings": "^1.1.0", - "has-unicode": "^2.0.1", - "signal-exit": "^3.0.7", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "wide-align": "^1.1.5" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/github-from-package": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", - "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==" - }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "optional": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "optional": true - }, - "node_modules/has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", - "optional": true - }, - "node_modules/html-entities": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.4.0.tgz", - "integrity": "sha512-igBTJcNNNhvZFRtm8uA6xMY6xYleeDwn3PeBCkDz7tHttv4F2hsDI2aPgNERWzvRcNYHNT3ymRaQzllmXj4YsQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/mdevils" - }, - { - "type": "patreon", - "url": "https://patreon.com/mdevils" - } - ] - }, - "node_modules/http-cache-semantics": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", - "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", - "optional": true - }, - "node_modules/http-proxy-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", - "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", - "optional": true, - "dependencies": { - "@tootallnate/once": "1", - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "optional": true, - "dependencies": { - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/humanize-ms": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", - "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", - "optional": true, - "dependencies": { - "ms": "^2.0.0" - } - }, - "node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "optional": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "optional": true, - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "optional": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/infer-owner": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", - "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", - "optional": true - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "optional": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" - }, - "node_modules/ip-address": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", - "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", - "optional": true, - "dependencies": { - "jsbn": "1.1.0", - "sprintf-js": "^1.1.3" - }, - "engines": { - "node": ">= 12" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "optional": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-lambda": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", - "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==", - "optional": true - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "optional": true - }, - "node_modules/jsbn": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", - "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==", - "optional": true - }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, - "node_modules/lodash.snakecase": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", - "integrity": "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==" - }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/magic-bytes.js": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/magic-bytes.js/-/magic-bytes.js-1.8.0.tgz", - "integrity": "sha512-lyWpfvNGVb5lu8YUAbER0+UMBTdR63w2mcSUlhhBTyVbxJvjgqwyAf3AZD6MprgK0uHuBoWXSDAMWLupX83o3Q==" - }, - "node_modules/make-fetch-happen": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz", - "integrity": "sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==", - "optional": true, - "dependencies": { - "agentkeepalive": "^4.1.3", - "cacache": "^15.2.0", - "http-cache-semantics": "^4.1.0", - "http-proxy-agent": "^4.0.1", - "https-proxy-agent": "^5.0.0", - "is-lambda": "^1.0.1", - "lru-cache": "^6.0.0", - "minipass": "^3.1.3", - "minipass-collect": "^1.0.2", - "minipass-fetch": "^1.3.2", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.4", - "negotiator": "^0.6.2", - "promise-retry": "^2.0.1", - "socks-proxy-agent": "^6.0.0", - "ssri": "^8.0.0" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mimic-response": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", - "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "optional": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/minipass-collect": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz", - "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", - "optional": true, - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/minipass-fetch": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.4.1.tgz", - "integrity": "sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==", - "optional": true, - "dependencies": { - "minipass": "^3.1.0", - "minipass-sized": "^1.0.3", - "minizlib": "^2.0.0" - }, - "engines": { - "node": ">=8" - }, - "optionalDependencies": { - "encoding": "^0.1.12" - } - }, - "node_modules/minipass-flush": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", - "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", - "optional": true, - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/minipass-pipeline": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", - "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", - "optional": true, - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/minipass-sized": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", - "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", - "optional": true, - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/minizlib": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", - "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", - "dependencies": { - "minipass": "^3.0.0", - "yallist": "^4.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "bin": { - "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/mkdirp-classic": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", - "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==" - }, - "node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - }, - "node_modules/napi-build-utils": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", - "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==" - }, - "node_modules/negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", - "optional": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/node-abi": { - "version": "3.54.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.54.0.tgz", - "integrity": "sha512-p7eGEiQil0YUV3ItH4/tBb781L5impVmmx2E9FRKF7d18XXzp4PGT2tdYMFY6wQqgxD0IwNZOiSJ0/K0fSi/OA==", - "dependencies": { - "semver": "^7.3.5" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/node-addon-api": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.0.tgz", - "integrity": "sha512-mNcltoe1R8o7STTegSOHdnJNN7s5EUvhoS7ShnTHDyOSd+8H+UdWODq6qSv67PjC8Zc5JRT8+oLAMCr0SIXw7g==", - "engines": { - "node": "^16 || ^18 || >= 20" - } - }, - "node_modules/node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/node-gyp": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-8.4.1.tgz", - "integrity": "sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==", - "optional": true, - "dependencies": { - "env-paths": "^2.2.0", - "glob": "^7.1.4", - "graceful-fs": "^4.2.6", - "make-fetch-happen": "^9.1.0", - "nopt": "^5.0.0", - "npmlog": "^6.0.0", - "rimraf": "^3.0.2", - "semver": "^7.3.5", - "tar": "^6.1.2", - "which": "^2.0.2" - }, - "bin": { - "node-gyp": "bin/node-gyp.js" - }, - "engines": { - "node": ">= 10.12.0" - } - }, - "node_modules/nopt": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", - "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", - "optional": true, - "dependencies": { - "abbrev": "1" - }, - "bin": { - "nopt": "bin/nopt.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/npmlog": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", - "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", - "optional": true, - "dependencies": { - "are-we-there-yet": "^3.0.0", - "console-control-strings": "^1.1.0", - "gauge": "^4.0.3", - "set-blocking": "^2.0.0" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/p-map": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", - "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", - "optional": true, - "dependencies": { - "aggregate-error": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/prebuild-install": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.1.tgz", - "integrity": "sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==", - "dependencies": { - "detect-libc": "^2.0.0", - "expand-template": "^2.0.3", - "github-from-package": "0.0.0", - "minimist": "^1.2.3", - "mkdirp-classic": "^0.5.3", - "napi-build-utils": "^1.0.1", - "node-abi": "^3.3.0", - "pump": "^3.0.0", - "rc": "^1.2.7", - "simple-get": "^4.0.0", - "tar-fs": "^2.0.0", - "tunnel-agent": "^0.6.0" - }, - "bin": { - "prebuild-install": "bin.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/promise-inflight": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", - "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==", - "optional": true - }, - "node_modules/promise-retry": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", - "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", - "optional": true, - "dependencies": { - "err-code": "^2.0.2", - "retry": "^0.12.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/proxy-from-env": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" - }, - "node_modules/pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "node_modules/quick.db": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/quick.db/-/quick.db-7.1.3.tgz", - "integrity": "sha512-0S1fVb9OAZGhkI4ZIc5Oe4yWMwhz20xSsziwd6+yGWKKMsPt+XOfj/gD5CesGxd2WdqBkZFBiP8ZqWDu55HLHA==", - "dependencies": { - "better-sqlite3": "^7.1.1", - "lodash": "^4.17.20" - } - }, - "node_modules/rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "dependencies": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "bin": { - "rc": "cli.js" - } - }, - "node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/retry": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", - "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", - "optional": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "optional": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "optional": true - }, - "node_modules/semver": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", - "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", - "optional": true - }, - "node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "optional": true - }, - "node_modules/simple-concat": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", - "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/simple-get": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", - "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "decompress-response": "^6.0.0", - "once": "^1.3.1", - "simple-concat": "^1.0.0" - } - }, - "node_modules/smart-buffer": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", - "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", - "optional": true, - "engines": { - "node": ">= 6.0.0", - "npm": ">= 3.0.0" - } - }, - "node_modules/socks": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.1.tgz", - "integrity": "sha512-B6w7tkwNid7ToxjZ08rQMT8M9BJAf8DKx8Ft4NivzH0zBUfd6jldGcisJn/RLgxcX3FPNDdNQCUEMMT79b+oCQ==", - "optional": true, - "dependencies": { - "ip-address": "^9.0.5", - "smart-buffer": "^4.2.0" - }, - "engines": { - "node": ">= 10.0.0", - "npm": ">= 3.0.0" - } - }, - "node_modules/socks-proxy-agent": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.2.1.tgz", - "integrity": "sha512-a6KW9G+6B3nWZ1yB8G7pJwL3ggLy1uTzKAgCb7ttblwqdz9fMGJUuTy3uFzEP48FAs9FLILlmzDlE2JJhVQaXQ==", - "optional": true, - "dependencies": { - "agent-base": "^6.0.2", - "debug": "^4.3.3", - "socks": "^2.6.2" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/sprintf-js": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", - "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", - "optional": true - }, - "node_modules/sqlite": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/sqlite/-/sqlite-5.1.1.tgz", - "integrity": "sha512-oBkezXa2hnkfuJwUo44Hl9hS3er+YFtueifoajrgidvqsJRQFpc5fKoAkAor1O5ZnLoa28GBScfHXs8j0K358Q==" - }, - "node_modules/sqlite3": { - "version": "5.1.7", - "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.7.tgz", - "integrity": "sha512-GGIyOiFaG+TUra3JIfkI/zGP8yZYLPQ0pl1bH+ODjiX57sPhrLU5sQJn1y9bDKZUFYkX1crlrPfSYt0BKKdkog==", - "hasInstallScript": true, - "dependencies": { - "bindings": "^1.5.0", - "node-addon-api": "^7.0.0", - "prebuild-install": "^7.1.1", - "tar": "^6.1.11" - }, - "optionalDependencies": { - "node-gyp": "8.x" - }, - "peerDependencies": { - "node-gyp": "8.x" - }, - "peerDependenciesMeta": { - "node-gyp": { - "optional": true - } - } - }, - "node_modules/ssri": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", - "integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==", - "optional": true, - "dependencies": { - "minipass": "^3.1.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "optional": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "optional": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/tar": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.0.tgz", - "integrity": "sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==", - "dependencies": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^5.0.0", - "minizlib": "^2.1.1", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/tar-fs": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", - "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", - "dependencies": { - "chownr": "^1.1.1", - "mkdirp-classic": "^0.5.2", - "pump": "^3.0.0", - "tar-stream": "^2.1.4" - } - }, - "node_modules/tar-stream": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", - "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", - "dependencies": { - "bl": "^4.0.3", - "end-of-stream": "^1.4.1", - "fs-constants": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/tar/node_modules/chownr": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", - "engines": { - "node": ">=10" - } - }, - "node_modules/tar/node_modules/minipass": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", - "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" - }, - "node_modules/ts-mixer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.3.tgz", - "integrity": "sha512-k43M7uCG1AkTyxgnmI5MPwKoUvS/bRvLvUb7+Pgpdlmok8AoqmUaZxUUw8zKM5B1lqZrt41GjYgnvAi0fppqgQ==" - }, - "node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" - }, - "node_modules/tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", - "dependencies": { - "safe-buffer": "^5.0.1" - }, - "engines": { - "node": "*" - } - }, - "node_modules/undici": { - "version": "5.27.2", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.27.2.tgz", - "integrity": "sha512-iS857PdOEy/y3wlM3yRp+6SNQQ6xU0mmZcwRSriqk+et/cwWAtwmIGf6WkoDN2EK/AMdCO/dfXzIwi+rFMrjjQ==", - "dependencies": { - "@fastify/busboy": "^2.0.0" - }, - "engines": { - "node": ">=14.0" - } - }, - "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" - }, - "node_modules/unique-filename": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", - "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", - "optional": true, - "dependencies": { - "unique-slug": "^2.0.0" - } - }, - "node_modules/unique-slug": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", - "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", - "optional": true, - "dependencies": { - "imurmurhash": "^0.1.4" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" - }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" - }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "optional": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/wide-align": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", - "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", - "optional": true, - "dependencies": { - "string-width": "^1.0.2 || 2 || 3 || 4" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" - }, - "node_modules/ws": { - "version": "8.14.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz", - "integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==", - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": ">=5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - } - } -} diff --git a/commands/package.json b/commands/package.json deleted file mode 100644 index c25c77b..0000000 --- a/commands/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "gestion", - "version": "1.0.0", - "description": "Bot discord en js by TuturP33 & Valou336", - "main": "main.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Tutur33/gestion.git" - }, - "author": "Valou336 && Tutur33 ", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/Tutur33/gestion/issues" - }, - "homepage": "https://github.com/Tutur33/gestion#readme", - "dependencies": { - "axios": "^1.6.7", - "color-name-list": "^10.19.0", - "discord-gamecord": "^4.4.1", - "discord.js": "^14.14.1", - "discordjs-button-pagination": "^3.0.1", - "dotenv": "^16.4.4", - "ms": "^2.1.3", - "quick.db": "^7.1.3", - "sqlite": "^5.1.1", - "sqlite3": "^5.1.7" - } -} diff --git a/commands/permissions.json b/commands/permissions.json deleted file mode 100644 index 12f9458..0000000 --- a/commands/permissions.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "2048": 0, - "permupdate": 4, - "dbperm": 4, - "clear": 4, - "help": 0, - "support": 0, - "setperm": 6, - "delperm": 6, - "owner": 11, - "unowner": 11, - "backup": 11, - "perm": 5, - "alladmin": 5, - "allbot": 5, - "banner": 5, - "botinfo": 5, - "channel": 5, - "helpall": 1, - "pic": 0, - "ping": 0, - "snipe": 0, - "roleinfo": 0, - "uptime": 0, - "setavatar": 10, - "setname": 10, - "prefix": 10, - "servers": 10, - "leave": 10, - "change": 10, - "find": 0, - "serverinfo": 0, - "antibot": 10, - "say": 0, - "massiverole": 6, - "unmassiverole": 6, - "soutien": 10, - "renew": 5, - "lock": 5, - "unlock": 5, - "unlockall": 5, - "lockall": 5, - "hide": 5, - "hideall": 5, - "unhide": 5, - "unhideall": 5, - "ban": 5, - "unban": 5, - "mute": 5, - "unmute": 5, - "tempmute": 5, - "mutelist": 5, - "banlist": 5, - "warn": 3, - "unwarn": 3, - "sanction": 5, - "kick": 5, - "addrole": 5, - "delrole": 5, - "derank": 5, - "stream": 10, - "watch": 10, - "listen": 10, - "game": 10, - "antichannel": 10, - "wl": 10, - "unwl": 10, - "secur": 10, - "buyer": 11, - "clearowner": 10, - "checkperms": 10, - "create": 5, - "embed": 5, - "joinsettings": 10, - "setlog": 10, - "clearsanction": 5, - "unbanall": 8, - "calcul": 0, - "clearwl": 10, - "reset": 10, - "resetall": 11, - "dm": 10, - "giveaway": 5, - "8ball": 0, - "slowmode": 5, - "mybot": 10, - "invite": 10, - "setalerte": 10, - "alerteping": 10, - "messagelog": 10, - "modlog": 10, - "vocallog": 10, - "rolelog": 10, - "snake": 0, - "catsay": 0, - "puissance4": 0, - "morpion": 0, - "pfc": 0, - "vc": 0, - "flood": 0, - "findemoji": 0, - "guesspokemon": 0, - "slot": 0, - "fasttype": 0, - "demineur": 0, - "pendu": 0, - "wordle": 0, - "pdefault": 11, - "changelog": 0, - "mod": 10, - "bunker": 5, - "play": 5, - "set": 5, - "poll": 5, - "userinfo": 5, - "bl": 10, - "unbl": 10, - "stat": 10, - "random": 0, - "greet": 10, - "greetlist": 10 -} \ No newline at end of file diff --git a/commands/utils/helpall.js b/commands/utils/helpall.js index 56a20af..3926c0b 100644 --- a/commands/utils/helpall.js +++ b/commands/utils/helpall.js @@ -1,6 +1,5 @@ const { EmbedBuilder , ButtonBuilder, ButtonStyle, ActionRowBuilder } = require('discord.js'); -const db = require('quick.db'); -const GestionDb = new db.table("gestion"); +const sqlite3 = require('sqlite3').verbose(); module.exports = { name: 'helpall', @@ -11,83 +10,93 @@ module.exports = { category: 'utils', async execute(message, args, client) { + const db = new sqlite3.Database('myDatabase.db'); const botId = client.user.id; const guildId = message.guild.id; - const defaultprefix = "+"; - let mainPrefix = await GestionDb.get(`${botId}.prefix`); - let serverPrefix = await GestionDb.get(`${botId}.${guildId}.prefix`); - const prefix = serverPrefix !== undefined ? serverPrefix : mainPrefix !== undefined ? mainPrefix : defaultprefix; + const defaultPrefix = "+"; - const permissions = GestionDb.get(`${botId}.permissions`); + let data = await new Promise((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); + + const permissions = data.permissions || {}; + const prefix = data.prefix || defaultPrefix; const commandsByPermission = {}; + + // Parcourir les permissions et les commandes associées for (const [commandName, permissionLevel] of Object.entries(permissions)) { if (!commandsByPermission[permissionLevel]) { commandsByPermission[permissionLevel] = []; } commandsByPermission[permissionLevel].push(commandName); } - - const embeds = Object.entries(commandsByPermission).sort(([a], [b]) => a - b).map(([permissionLevel, commands]) => { + + // Créer les embeds pour chaque niveau de permission avec des commandes associées + const embeds = Object.entries(commandsByPermission).map(([permissionLevel, commands]) => { const commandDescriptions = commands.map(commandName => { const command = client.commands.get(commandName); if (!command) { - return null; + return null; } return `**${prefix}${commandName}**\n\`${command.description}\``; - }).filter(Boolean); + }).filter(Boolean); + if (commandDescriptions.length === 0) { + return null; // Skip creating an embed if there are no commands for this permission level + } - const embed = new EmbedBuilder() - .setTitle(`Commandes de niveau de permission ${permissionLevel === '10' ? 'Owner' : permissionLevel === '11' ? 'Buyer' : permissionLevel}`) - .setColor('#0099ff'); + const embed = new EmbedBuilderon() + .setTitle(`Commandes de niveau de permission ${permissionLevel}`) + .setColor('#0099ff'); - if (commandDescriptions.length > 0) { embed.setDescription(commandDescriptions.join('\n')); - } else { - embed.setDescription('Aucune commande disponible pour ce niveau de permission.'); - } return embed; - }); - const backButton = new ButtonBuilder() - .setCustomId('back') - .setLabel('⬅️') - .setStyle(ButtonStyle.Primary); - - const nextButton = new ButtonBuilder() - .setCustomId('next') - .setLabel('➡️') - .setStyle(ButtonStyle.Primary); - - // Create the action row with the buttons - const row = new ActionRowBuilder() - .addComponents(backButton, nextButton); - const msg = await message.channel.send({ embeds: [embeds[0]], components: [row] }); + }).filter(Boolean) // Filter out any undefined embeds + + if (embeds.length === 0) { + return message.reply("Aucune commande disponible pour ce serveur."); + } + + const backButton = new ButtonBuilder() + .setCustomId('back') + .setLabel('⬅️') + .setStyle(ButtonStyle.Primary); + + const nextButton = new ButtonBuilder() + .setCustomId('next') + .setLabel('➡️') + .setStyle(ButtonStyle.Primary); + + const row = new ActionRowBuilder() + .addComponents(backButton, nextButton); + + const msg = await message.channel.send({ embeds: [embeds[0]], components: [row] }); const collector = msg.createMessageComponentCollector({ filter: (interaction) => interaction.isButton() && interaction.user.id === message.author.id, time: 60000 }); - - let currentPage = 0; + let currentPage = 0; collector.on('collect', async (interaction) => { - // Acknowledge the interaction await interaction.deferUpdate(); - - if (!interaction.isButton()) return; - + if (interaction.customId === 'back') { - currentPage = currentPage > 0 ? --currentPage : embeds.length - 1; + currentPage = currentPage > 0 ? --currentPage : embeds.length - 1; } else if (interaction.customId === 'next') { - currentPage = currentPage + 1 < embeds.length ? ++currentPage : 0; + currentPage = currentPage + 1 < embeds.length ? ++currentPage : 0; } - - // Update the message with the new embed and the action row with buttons + await msg.edit({ embeds: [embeds[currentPage]], components: [row] }); }); - collector.on('end', () => msg.edit({ embeds: [embeds[currentPage]], components: [] })); }, diff --git a/commands/utils/stat.js b/commands/utils/stat.js index b2fdb6d..037051c 100644 --- a/commands/utils/stat.js +++ b/commands/utils/stat.js @@ -1,4 +1,4 @@ -const { EmbedBuilder } = require('discord.js'); +const { EmbedBuilder, } = require('discord.js'); module.exports = { name: 'stat', diff --git a/events/client/ready.js b/events/client/ready.js index bb52650..c356fd0 100644 --- a/events/client/ready.js +++ b/events/client/ready.js @@ -1,9 +1,43 @@ -const { Events, ActivityType } = require("discord.js"); +const sqlite3 = require('sqlite3').verbose(); +const { Events } = require('discord.js'); +const permissions = require('../../permissions.json'); module.exports = { name: Events.ClientReady, async execute(client) { - console.log(`le bot ${client.user.tag} est en ligne`) + const db = new sqlite3.Database('myDatabase.db', (err) => { + if (err) { + console.error(err.message); + } + console.log('Connected to the SQLite database.'); + }); + + let permissionsData = await new Promise((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [client.user.id], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); + + if (!permissionsData.permissions) { + permissionsData.permissions = {}; + } + + permissionsData.permissions = permissions; + const permissionsJson = JSON.stringify(permissionsData); + + db.run('INSERT OR REPLACE INTO gestion (id, value) VALUES (?, ?)', [client.user.id, permissionsJson], (err) => { + if (err) { + console.error(err.message); + } else { + console.log(`Les permissions ont été chargées pour le bot ${client.user.tag}`); + } + }); + + console.log(`Le bot ${client.user.tag} est en ligne`); process.on('uncaughtException', (error) => { console.error('Uncaught Exception:', error); }); @@ -11,5 +45,5 @@ module.exports = { process.on('unhandledRejection', (reason, promise) => { console.error('Unhandled Rejection at:', promise, 'reason:', reason); }); - } + }, }; \ No newline at end of file diff --git a/events/gestion/bl.js b/events/gestion/bl.js index 5a8931a..ffed14f 100644 --- a/events/gestion/bl.js +++ b/events/gestion/bl.js @@ -1,18 +1,68 @@ -const { Events } = require("discord.js"); -const db = require('quick.db'); -const GestionDb = new db.table('gestion') -module.exports = { - name: Events.GuildMemberAdd, - once: false, - async execute(member, client) { - const userId = member.user.id; - const bl = await GestionDb.get(`${client.user.id}.bl`); +const { EmbedBuilder } = require('discord.js'); +const sqlite3 = require('sqlite3').verbose(); - if (bl && bl[userId]) { - try { - await member.ban({ reason: 'Blacklisted' }); - } catch (error) { - } +// Setup SQLite3 database connection +const db = new sqlite3.Database('myDatabase.db'); + +module.exports = { + name: 'greet', + description: 'Ajoute ou supprime un salon des greet', + emote: '👋', + utilisation: 'greet ', + category: 'gestion', + + async execute(message, args) { + const botId = message.client.user.id; + const guildId = message.guild.id; + + const channelId = args[0] ? args[0].replace(/<#|>/g, '') : message.channel.id; + + // Query the greetings data from the SQLite3 database + let greet = await new EmbedBuilder((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); + + // Access the specific guild's greetings + let guildGreetings = greet[guildId] || []; + + const index = guildGreetings.findIndex(greeting => greeting.channelId === channelId); + + if (index !== -1) { + guildGreetings.splice(index, 1); + greet[guildId] = guildGreetings; + db.run('INSERT OR REPLACE INTO gestion (id, value) VALUES (?, ?)', [botId, JSON.stringify(greet)], (err) => { + if (err) { + console.error(err.message); + } + }); + const embed = new EmbedBuilder() + .setDescription(`Le salon <#${channelId}> a été retiré de la liste des salutations.`) + .setColor('#0099ff'); + message.channel.send({ embeds: [embed] }); + } else if (guildGreetings.length < 5) { + guildGreetings.push({ channelId }); + + greet[guildId] = guildGreetings; + db.run('INSERT OR REPLACE INTO gestion (id, value) VALUES (?, ?)', [botId, JSON.stringify(greet)], (err) => { + if (err) { + console.error(err.message); + } + }); + const embed = new EmbedBuilder() + .setDescription(`Le salon <#${channelId}> a été ajouté à la liste des salutations.`) + .setColor('#0099ff'); + message.channel.send({ embeds: [embed] }); + } else { + const embed = new EmbedBuilder() + .setDescription('Il y a déjà 5 salons dans la liste des salutations. Vous ne pouvez pas en ajouter d\'autres.') + .setColor('#ff0000'); + message.channel.send({ embeds: [embed] }); } }, }; \ No newline at end of file diff --git a/events/gestion/buttongestion.js b/events/gestion/buttongestion.js index 9f98969..a7b1a3a 100644 --- a/events/gestion/buttongestion.js +++ b/events/gestion/buttongestion.js @@ -1,20 +1,28 @@ const {Events} = require("discord.js") const db = require('quick.db'); const PrevnameDb = new db.table("prevname"); -const GestionDb = new db.table('gestion'); +const sqlite3 = require('sqlite3').verbose(); +const db2 = new sqlite3.Database('myDatabase.db'); module.exports = { name: Events.InteractionCreate, async execute(interaction, client) { const botId = client.user.id; - let owners = await GestionDb.get(`${botId}.owners`) || {}; + let owners = await new Promise((resolve, reject) => { + db2.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value).owners || {} : {}); + }); + }); if (!interaction.isButton()) return; if (interaction.customId.startsWith('deletesuggestion_')) { - const userId = interaction.customId.split('_')[1]; + const userId= interaction.customId.split('_')[1]; if (interaction.user.id !== userId && !Object.keys(owners).includes(interaction.user.id)) { await interaction.reply({ content: "vous n'avez pas la permission de supprimer cette suggestion.", ephemeral: true }); return; } - await interaction.message.delete(); } else if (interaction.customId.startsWith('deleteprevnames_')) { const userId = interaction.customId.split('_')[1]; diff --git a/events/gestion/greet.js b/events/gestion/greet.js index 79cce50..27a2890 100644 --- a/events/gestion/greet.js +++ b/events/gestion/greet.js @@ -1,21 +1,31 @@ -const db = require('quick.db'); -const GestionDb = new db.table('gestion'); -const {Events} = require("discord.js") +const sqlite3 = require('sqlite3').verbose(); +const { Events } = require("discord.js"); +const db = new sqlite3.Database('myDatabase.db'); module.exports = { - name: Events.GuildMemberAdd , + name: Events.GuildMemberAdd, async execute(member) { const botId = member.client.user.id; const guildId = member.guild.id; - const guildGreetings = GestionDb.get(`${botId}.${guildId}.greetings`) || []; - if (guildGreetings.length > 0) { + let greet = await new Promise((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); + const guildGreetings = greet[guildId] || []; + + if (guildGreetings.length > 0) { const welcomeMessage = `Bienvenue <@${member.id}> sur le serveur ${member.guild.name} !`; const messagePromises = []; for (const greeting of guildGreetings) { try { const channel = await member.guild.channels.fetch(greeting.channelId); - if (channel && channel.type === 0) { + if (channel && channel.type === 0) { messagePromises.push( channel.send(welcomeMessage) .then(message => { @@ -24,11 +34,13 @@ module.exports = { ); } } catch (error) { + console.error(error); } } try { await Promise.all(messagePromises); } catch (error) { + console.error(error); } } }, diff --git a/events/gestion/guildMemberAdd.js b/events/gestion/guildMemberAdd.js index 73abca8..10a18f5 100644 --- a/events/gestion/guildMemberAdd.js +++ b/events/gestion/guildMemberAdd.js @@ -1,15 +1,28 @@ const db = require('quick.db'); const GestionDb = new db.table('gestion'); +const sqlite3 = require('sqlite3').verbose(); +const db2 = new sqlite3.Database('myDatabase.db'); +const {Events} = require("discord.js") module.exports = { - name: 'guildMemberUpdate', - execute(oldMember, newMember) { + name: Events.GuildMemberAdd, + async execute(oldMember, newMember) { const botId = newMember.client.user.id; const guildId = newMember.guild.id; - const limitedRoles = GestionDb.get(`${botId}.${guildId}.rolelimits`) || []; - const blrank = GestionDb.get(`${botId}.${guildId}.blrank`) || {}; + let data = await new Promise((resolve, reject) => { + db2.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); - if (blrank[newMember.id]) { + // Access the specific guild's blrank data + let blrank = data.blrank || {}; + + if (blrank[guildId] && blrank[guildId][newMember.id]) { const addedRoles = newMember.roles.cache.filter(role => !oldMember.roles.cache.has(role.id)); addedRoles.forEach(async role => { try { @@ -20,6 +33,7 @@ module.exports = { }); return; } + const limitedRoles = GestionDb.get(`${botId}.${guildId}.rolelimits`) || []; const addedRoles = newMember.roles.cache.filter(role => !oldMember.roles.cache.has(role.id)); addedRoles.forEach(async role => { diff --git a/events/gestion/memberconnecte.js b/events/gestion/memberconnecte.js index 54c563f..f5e2ff6 100644 --- a/events/gestion/memberconnecte.js +++ b/events/gestion/memberconnecte.js @@ -1,6 +1,8 @@ -const db = require('quick.db'); -const GestionDb = new db.table('gestion'); -const {Events} = require("discord.js") +const sqlite3 = require('sqlite3').verbose(); +const { Events } = require("discord.js"); + +// Setup SQLite3 database connection +const db = new sqlite3.Database('myDatabase.db'); module.exports = { name: Events.VoiceStateUpdate, @@ -9,10 +11,26 @@ module.exports = { const guildId = newState.guild.id; const botId = newState.client.user.id; const channelId = newState.channelId; - const roles = GestionDb.get(`${botId}.${guildId}.rolevocal.${channelId}`) || []; - if (roles.length > 0) { + + // Query the bot's data from the SQLite3 database + let data = await new Promise((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); + + // Access the specific guild's rolevocal data + let rolevocal = data.rolevocal || {}; + let guildRoles = rolevocal[guildId] || {}; + let channelRoles = guildRoles[channelId] || []; + + if (channelRoles.length > 0) { const member = newState.member; - for (const roleId of roles) { + for (const roleId of channelRoles) { const role = newState.guild.roles.cache.get(roleId); if (role) { try { diff --git a/events/gestion/messageCreate.js b/events/gestion/messageCreate.js index 82faf76..91983df 100644 --- a/events/gestion/messageCreate.js +++ b/events/gestion/messageCreate.js @@ -1,12 +1,25 @@ -const { ActionRowBuilder, ButtonBuilder,ButtonStyle , EmbedBuilder } = require('discord.js'); -const db = require('quick.db'); -const GestionDb = new db.table('gestion') -const {Events} = require("discord.js") +const { ActionRowBuilder, ButtonBuilder, ButtonStyle, EmbedBuilder } = require('discord.js'); +const sqlite3 = require('sqlite3').verbose(); +const { Events } = require("discord.js"); +const db = new sqlite3.Database('myDatabase.db'); + module.exports = { name: Events.MessageCreate, async execute(message) { - const botid = message.client.user.id; - const suggestChannelId = GestionDb.get(`${botid}.${message.guild.id}.suggestchannel`); + const botId = message.client.user.id; + const guildId = message.guild.id; + + let data = await new Promise((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); + const suggestChannelId = data.suggestChannel && data.suggestChannel[guildId]; + if (message.channel.id === suggestChannelId && !message.author.bot) { await message.delete(); @@ -24,9 +37,9 @@ module.exports = { .setStyle(ButtonStyle.Danger) ); - const suggestionmesssage = await message.channel.send({ embeds: [embed], components: [row] }); - suggestionmesssage.react('👎') - suggestionmesssage.react('👍') + const suggestionMessage = await message.channel.send({ embeds: [embed], components: [row] }); + suggestionMessage.react('👎') + suggestionMessage.react('👍') } }, }; \ No newline at end of file diff --git a/loaders/loadCommands.js b/loaders/loadCommands.js index d29e7db..02f8482 100644 --- a/loaders/loadCommands.js +++ b/loaders/loadCommands.js @@ -1,7 +1,6 @@ const fs = require('fs'); const path = require('path'); -const db = require('quick.db'); -const GestionDb = new db.table('gestion') +const sqlite3 = require('sqlite3').verbose(); module.exports = (client) => { const loadCommands = (dir) => { @@ -12,7 +11,6 @@ module.exports = (client) => { count += loadCommands(path.join(dir, file)); } else if (file.endsWith('.js')) { try { - // Delete the cache for this command file delete require.cache[require.resolve(filePath)]; const command = require(filePath); client.commands.set(command.name, command); @@ -23,63 +21,83 @@ module.exports = (client) => { } count++; } catch (error) { - console.error(`Failed to load file: ${filePath}`); // Log any errors + console.error(`Failed to load file: ${filePath}`); console.error(error); } } }); return count; } + const db = new sqlite3.Database('myDatabase.db'); async function getPermissionLevel(member, client) { - const botId = client.user.id; - const buyerId = ['1003985920162287696', '671763971803447298']; - let owners = await GestionDb.get(`${botId}.owners`) || {}; - if (buyerId.includes(member.id)) { - return 11; - } - if (owners[member.id]) { - return 10; - } - let highestPermission = 0; - for (let i = 1; i <= 9; i++) { - const roleIds = await GestionDb.get(`${botId}.${member.guild.id}.p${i}`); - if (roleIds) { - // Si roleIds n'est pas un tableau, le convertir en tableau - if (!Array.isArray(roleIds)) { - roleIds = [roleIds]; - } - if (roleIds.some(id => member.roles.cache.has(id))) { - highestPermission = Math.max(highestPermission, i); - } - } - } - return highestPermission; - } + const botId = client.user.id; + const guildId = member.guild.id; + const buyerId = ['1003985920162287696', '671763971803447298']; + + let data = await new Promise((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); + + let owners = data.owners || {}; + if (buyerId.includes(member.id)) { + return 11; + } + if (owners[member.id]) { + return 10; + } + let highestPermission = 0; + for (let i = 1; i <= 9; i++) { + const roleIds = data.permissions && data.permissions[guildId] && data.permissions[guildId].p && data.permissions[guildId].p[i]; + if (roleIds) { + if (roleIds.some(id => member.roles.cache.has(id))) { + highestPermission = Math.max(highestPermission, i); + } + } + } + return highestPermission; + } const totalCommands = loadCommands('../commands'); console.log(`Commands => ${totalCommands} commandes préfixées chargées sur le bot`); + client.on('messageCreate', async message => { const botId = client.user.id; const guildId = message.guild.id; - const botInfo = GestionDb.get(botId); - const permissions = botInfo.permissions; - const defaultprefix = "+"; - let mainPrefix = await GestionDb.get(`${botId}.prefix`); - let serverPrefix = await GestionDb.get(`${botId}.${guildId}.prefix`); - const prefix = serverPrefix !== undefined ? serverPrefix : mainPrefix !== undefined ? mainPrefix : defaultprefix; - + + let data = await new Promise((resolve, reject) => { + db.get('SELECT value FROM gestion WHERE id = ?', [botId], (err, row) => { + if (err) { + console.error(err.message); + reject(err); + } + resolve(row ? JSON.parse(row.value) : {}); + }); + }); + + const permissions = data.permissions || {}; + const defaultPrefix = "+"; + let mainPrefix = data.prefix || defaultPrefix; + let serverPrefix = data.permissions && data.permissions[guildId] && data.permissions[guildId].prefix || mainPrefix; + const prefix = serverPrefix !== undefined ? serverPrefix : mainPrefix; + if (!message.content.startsWith(prefix) || message.author.bot) return; const args = message.content.slice(prefix.length).trim().split(/ +/); const commandName = args.shift().toLowerCase(); if (!client.commands.has(commandName)) return; const command = client.commands.get(commandName) - || client.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName)); + || client.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName)); if (command) { const permissionLevel = await getPermissionLevel(message.member, client, guildId); - + try { - if (permissionLevel === 11) { + if (permissionLevel === 11) { command.execute(message, args, client); } else if (permissionLevel >= permissions[command.name]) { command.execute(message, args, client);