tg fix placement instructions header
Deploy service tg-bot / service tg-bot (push) Successful in 1m37s

This commit is contained in:
2024-12-19 12:11:08 +02:00
parent a12a80d5d5
commit 15861a8d59
@@ -135,15 +135,20 @@ export async function newQRCodeConversation(
new InputFile(new Uint8Array(pngBuffer.buffer), "qr.png"),
);
const { value: instruction } = await publicSettingsDb
const instruction = await publicSettingsDb
.get(`public_settings:placement_instructions_${typedPlacement}`)
.then((doc) => {
return doc.value.replace(/^#+\s*([^\n\r]*)$/m, "*$1*");
})
.catch((error) => {
console.error(error);
return { value: "Разместите этот код на вашем объекте." };
});
const urlText = url.replace("https://", "");
await ctx.reply(
`${instruction}\n\nВ этом QR-коде хранится ссылка ${url}`.trim(),
`В этом QR-коде хранится ссылка [${urlText}](${url})\n\n${instruction}`.trim(),
{
parse_mode: "Markdown",
},