diff --git a/.gitignore b/.gitignore index 3c3629e..db59a65 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,6 @@ node_modules +.env +.env.local +.env.development.local +.env.test.local +.env.production.local \ No newline at end of file diff --git a/src/components/ContactBlock.js b/src/components/ContactBlock.js index 4a92b78..3e4267c 100644 --- a/src/components/ContactBlock.js +++ b/src/components/ContactBlock.js @@ -136,10 +136,13 @@ export default function ContactBlock() { 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 = { - chat_id: 1017685666, // Telegram chat id + chat_id: chatId, // Telegram chat id text: text // The text to send };