commands: localize generic bot commands

This commit is contained in:
2026-05-10 22:53:32 +03:00
parent 3d14e3c0d5
commit 94d695e008
33 changed files with 341 additions and 299 deletions
+7 -7
View File
@@ -8,8 +8,8 @@ import {botUser} from "../index";
export class AdminsAdd extends Command {
command = "addAdmin";
title = "/addAdmin";
description = "Add user to admins";
title = Environment.commandTitles.adminsAdd;
description = Environment.commandDescriptions.adminsAdd;
requirements = Requirements.Build(
Requirement.BOT_CREATOR,
@@ -24,19 +24,19 @@ export class AdminsAdd extends Command {
const text = fullName(msg.reply_to_message.from);
if (id === botUser.id) {
await oldSendMessage(msg, "Бот не может сам себя сделать админом").catch(logError);
await oldSendMessage(msg, Environment.botCannotMakeItselfAdminText).catch(logError);
return;
}
if (id === Environment.CREATOR_ID) {
await oldSendMessage(msg, "Создатель бота и так является админом").catch(logError);
await oldSendMessage(msg, Environment.botCreatorAlreadyAdminText).catch(logError);
return;
}
if (await Environment.addAdmin(id)) {
await oldSendMessage(msg, text + " теперь админ!").catch(logError);
await oldSendMessage(msg, Environment.getUserIsNowAdminText(text)).catch(logError);
} else {
await oldSendMessage(msg, text + " и так уже админ 🤔").catch(logError);
await oldSendMessage(msg, Environment.getUserAlreadyAdminText(text)).catch(logError);
}
}
}
}