diff --git a/package.json b/package.json index a4b50db..cd780be 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedystiamd", - "version": "3.1.1", + "version": "3.1.2", "description": "A whatsapp bot that can be used to play music", "main": "index.js", "type": "commonjs", diff --git a/src/commands/owner/init.js b/src/commands/owner/init.js index 9c4b5b6..c9437cd 100644 --- a/src/commands/owner/init.js +++ b/src/commands/owner/init.js @@ -1,6 +1,9 @@ module.exports = { name: "init", run: async ({ bot, lang, message }) => { + if (global.db.config.select("owner", { id: "owner" })[0].value) { + return bot.sendMessage(message.chat, { text: lang.owner.alreadyInit }, { quoted: message }); + } global.db.config.update("owner", { id: "owner" }, { value: message.sender }); return bot.sendMessage(message.chat, { text: lang.owner.defaultOwner }, { quoted: message }); }, diff --git a/src/lang/en/bot.json b/src/lang/en/bot.json index d593470..b738b60 100644 --- a/src/lang/en/bot.json +++ b/src/lang/en/bot.json @@ -68,7 +68,8 @@ }, "defaultOwner": "✔️ | Now you are the owner of the bot if you want another user to be the new bot owner use the command {6}setowner", "noOwner": "❌ | The bot has no owner you must use the {6}init command to get that rank", - "newOwner": "✔️ | The former owner has just relinquished privileges and now there is a new owner" + "newOwner": "✔️ | The former owner has just relinquished privileges and now there is a new owner", + "alreadyInit": "❌ | The bot is already initialized" }, "automod": { "antilinks": "❌ | Error: I don't have admin so I can't delete links." diff --git a/src/lang/es/bot.json b/src/lang/es/bot.json index 1c61477..432f78d 100644 --- a/src/lang/es/bot.json +++ b/src/lang/es/bot.json @@ -68,7 +68,8 @@ }, "defaultOwner": "✔️ | Ahora eres el dueño del bot si quieres que otro usuario sea el nuevo dueño del bot usa el comando {6}setowner", "noOwner": "❌ | El bot no tiene dueño debes usar el comando {6}init para obtener ese rango", - "newOwner": "✔️ | El antiguo dueño acaba de renunciar a sus privilegios y ahora hay un nuevo dueño" + "newOwner": "✔️ | El antiguo dueño acaba de renunciar a sus privilegios y ahora hay un nuevo dueño", + "alreadyInit": "❌ | El bot ya está inicializado" }, "automod": { "antilinks": "❌ | Error: No tengo admin así que no puedo borrar enlaces."