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!");
|
||||
}
|
||||
|
||||
const submittedData: { email: unknown, where: unknown } = await req.json();
|
||||
const submittedData = await req.json();
|
||||
|
||||
const text = encodeURIComponent(`
|
||||
*Новое письмо с flexpatrol.ru*
|
||||
\`\`\`
|
||||
email: ${submittedData.email}
|
||||
на че наклеешь: ${submittedData.where}
|
||||
\`\`\`
|
||||
`)
|
||||
${JSON.stringify(submittedData)}
|
||||
\`\`\``)
|
||||
|
||||
await fetch(`https://api.telegram.org/bot${BOT_TOKEN}/sendMessage?chat_id=${CHAT_ID}&text=${text}&parse_mode=markdown`)
|
||||
|
||||
return new Response('success', {
|
||||
|
||||
Reference in New Issue
Block a user