env for tg

This commit is contained in:
belikovme 2024-11-25 19:54:19 +07:00
parent 9d3f51aa05
commit 32c5fcf2ac
2 changed files with 10 additions and 2 deletions

5
.gitignore vendored
View File

@ -1 +1,6 @@
node_modules node_modules
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

View File

@ -136,10 +136,13 @@ export default function ContactBlock() {
function sendMessage(text) function sendMessage(text)
{ {
const url = `https://api.telegram.org/bot8190149729:AAH1n6QXzaU__EwRhrPbEn9fqrFbPRRLFaI/sendMessage` // The url to request const botToken = process.env.REACT_APP_TELEGRAM_BOT_TOKEN;
const chatId = process.env.REACT_APP_TELEGRAM_CHAT_ID;
const url = `https://api.telegram.org/bot${botToken}/sendMessage`;
const obj = { const obj = {
chat_id: 1017685666, // Telegram chat id chat_id: chatId, // Telegram chat id
text: text // The text to send text: text // The text to send
}; };