add economi system

This commit is contained in:
Arthur Puechberty
2026-01-17 18:52:16 +01:00
parent 6c9241f349
commit 7d706b4d79
20 changed files with 2123 additions and 9 deletions
+22
View File
@@ -24,6 +24,28 @@ module.exports = {
);
if (!command) return;
// Vérification du scope / guildCondition
if (command.scope === "guild") {
const guildId = message.guild ? message.guild.id : null;
if (!guildId)
return message
.reply({ content: "Cette commande ne peut pas être utilisée en message privé." })
.then((msg) => setTimeout(() => msg.delete(), 5000));
if (typeof command.guildCondition === "function") {
let allowed = false;
try {
allowed = await command.guildCondition(guildId);
} catch (err) {
console.error(`Erreur guildCondition pour la guild ${guildId}`, err);
allowed = false;
}
if (!allowed)
return message
.reply({ content: "Cette commande est désactivée sur ce serveur." })
.then((msg) => setTimeout(() => msg.delete(), 5000));
}
}
if (command.dm !== true && message.channel.type === 1)
return message
.reply({
+18 -1
View File
@@ -1,4 +1,3 @@
module.exports = {
name: "interactionCreate",
async execute(client, interaction) {
@@ -7,6 +6,24 @@ module.exports = {
const command = client.commands.get(interaction.commandName);
if (!command) return;
// Vérification du scope / guildCondition
if (command.scope === "guild") {
const guildId = interaction.guild ? interaction.guild.id : null;
if (!guildId)
return interaction.reply({ content: "Cette commande ne peut pas être utilisée en message privé.", ephemeral: true });
if (typeof command.guildCondition === "function") {
let allowed = false;
try {
allowed = await command.guildCondition(guildId);
} catch (err) {
console.error(`Erreur guildCondition pour la guild ${guildId}`, err);
allowed = false;
}
if (!allowed)
return interaction.reply({ content: "Cette commande est désactivée sur ce serveur.", ephemeral: true });
}
}
if (command.dm !== true && interaction.channel.type === 1)
return interaction.reply({
content: "Cette commande ne peut pas être utilisée en message privé.",