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
+9 -9
View File
@@ -1,17 +1,17 @@
import {Command} from "../base/command";
import {Message} from "typescript-telegram-bot-api";
import {logError, oldReplyToMessage} from "../util/utils";
import {Environment} from "../common/environment";
export class Id extends Command {
title = "/id";
description = "ID of chat, user and reply (if replied to any message)";
title = Environment.commandTitles.id;
description = Environment.commandDescriptions.id;
async execute(msg: Message): Promise<void> {
let text = `chat id: \n\`\`\`${msg.chat.id}\`\`\` \nfrom id: \n\`\`\`${msg.from?.id}\`\`\``;
if (msg.reply_to_message) {
text += ` \nreply id: \n\`\`\`${msg.reply_to_message.from?.id}\`\`\``;
}
await oldReplyToMessage(msg, text, "MarkdownV2").catch(logError);
await oldReplyToMessage(
msg,
Environment.getIdText(msg.chat.id, msg.from?.id, msg.reply_to_message?.from?.id),
"MarkdownV2",
).catch(logError);
}
}
}