mirror of
https://github.com/arthur-pbty/gestion.git
synced 2026-06-05 08:11:57 +02:00
27 lines
925 B
JavaScript
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}.`);
|
|
}
|
|
},
|
|
}; |