commands: localize generic bot commands
This commit is contained in:
+9
-9
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user