Show stringified data
This commit is contained in:
9
index.ts
9
index.ts
@@ -9,15 +9,14 @@ const server = Bun.serve({
|
|||||||
throw new Error("woops!");
|
throw new Error("woops!");
|
||||||
}
|
}
|
||||||
|
|
||||||
const submittedData: { email: unknown, where: unknown } = await req.json();
|
const submittedData = await req.json();
|
||||||
|
|
||||||
const text = encodeURIComponent(`
|
const text = encodeURIComponent(`
|
||||||
*Новое письмо с flexpatrol.ru*
|
*Новое письмо с flexpatrol.ru*
|
||||||
\`\`\`
|
\`\`\`
|
||||||
email: ${submittedData.email}
|
${JSON.stringify(submittedData)}
|
||||||
на че наклеешь: ${submittedData.where}
|
\`\`\``)
|
||||||
\`\`\`
|
|
||||||
`)
|
|
||||||
await fetch(`https://api.telegram.org/bot${BOT_TOKEN}/sendMessage?chat_id=${CHAT_ID}&text=${text}&parse_mode=markdown`)
|
await fetch(`https://api.telegram.org/bot${BOT_TOKEN}/sendMessage?chat_id=${CHAT_ID}&text=${text}&parse_mode=markdown`)
|
||||||
|
|
||||||
return new Response('success', {
|
return new Response('success', {
|
||||||
|
|||||||
Reference in New Issue
Block a user