feat: add Telegram message verification code copy

This commit is contained in:
eoao
2026-05-10 01:15:50 +08:00
parent d48b139aed
commit baa70a863c

View File

@@ -52,6 +52,23 @@ const telegramService = {
const jwtToken = await jwtUtils.generateToken(c, { emailId: email.emailId })
const webAppUrl = customDomain ? `${domainUtils.toOssDomain(customDomain)}/api/telegram/getEmail/${jwtToken}` : 'https://www.cloudflare.com/404'
const inlineKeyboard = [
[
{
text: '查看',
web_app: { url: webAppUrl }
}
]
];
if (email.code) {
inlineKeyboard.push([
{
text: email.code,
copy_text: { text: email.code }
}
]);
}
await Promise.all(tgChatIds.map(async chatId => {
try {
@@ -65,14 +82,7 @@ const telegramService = {
parse_mode: 'HTML',
text: emailMsgTemplate(email, tgMsgTo, tgMsgFrom, tgMsgText),
reply_markup: {
inline_keyboard: [
[
{
text: '查看',
web_app: { url: webAppUrl }
}
]
]
inline_keyboard: inlineKeyboard
}
})
});