Files
gestion/commands/gestion/prefix.js
T

27 lines
925 B
JavaScript

const db = require('quick.db');
const GestionDb = new db.table("gestion");
module.exports = {
name: 'prefix',
description: 'Change le préfixe du bot ',
emote: '🔧',
utilisation: 'prefix <newprefix/main>',
category: 'botcontrol',
async execute(message, args, client) {
const botId = client.user.id;
const guildId = message.guild.id;
if (args.length < 1) {
return message.reply('Veuillez spécifier un nouveau préfixe.');
}
if (args[0] === "main") {
const newPrefix = args[1];
await GestionDb.set(`${botId}.prefix`, newPrefix);
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}.`);
}
},
};