tg fix placement instructions header
Deploy service tg-bot / service tg-bot (push) Successful in 1m37s
Deploy service tg-bot / service tg-bot (push) Successful in 1m37s
This commit is contained in:
@@ -135,15 +135,20 @@ export async function newQRCodeConversation(
|
|||||||
new InputFile(new Uint8Array(pngBuffer.buffer), "qr.png"),
|
new InputFile(new Uint8Array(pngBuffer.buffer), "qr.png"),
|
||||||
);
|
);
|
||||||
|
|
||||||
const { value: instruction } = await publicSettingsDb
|
const instruction = await publicSettingsDb
|
||||||
.get(`public_settings:placement_instructions_${typedPlacement}`)
|
.get(`public_settings:placement_instructions_${typedPlacement}`)
|
||||||
|
.then((doc) => {
|
||||||
|
return doc.value.replace(/^#+\s*([^\n\r]*)$/m, "*$1*");
|
||||||
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
return { value: "Разместите этот код на вашем объекте." };
|
return { value: "Разместите этот код на вашем объекте." };
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const urlText = url.replace("https://", "");
|
||||||
|
|
||||||
await ctx.reply(
|
await ctx.reply(
|
||||||
`${instruction}\n\nВ этом QR-коде хранится ссылка ${url}`.trim(),
|
`В этом QR-коде хранится ссылка [${urlText}](${url})\n\n${instruction}`.trim(),
|
||||||
{
|
{
|
||||||
parse_mode: "Markdown",
|
parse_mode: "Markdown",
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user