add prefix changeble with serveur and main prefix configurable

This commit is contained in:
VALOU3336
2024-02-15 20:59:10 +01:00
parent d16a132d4d
commit 16335991dc
9 changed files with 55 additions and 23 deletions
+5 -2
View File
@@ -56,8 +56,11 @@ module.exports = (client) => {
const guildId = message.guild.id;
const botInfo = GestionDb.get(botId);
const permissions = botInfo.permissions;
//const prefix = botTokens.coins[botId].prefix;
const prefix = '+';
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;
if (!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).trim().split(/ +/);