feat: add Telegram message verification code copy
This commit is contained in:
@@ -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
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user