diff --git a/E-Purchasing.js b/E-Purchasing.js index 60d4ca7..be37137 100644 --- a/E-Purchasing.js +++ b/E-Purchasing.js @@ -1,6 +1,5 @@ const axios = require('axios'); const { google } = require('googleapis'); -const TelegramBot = require('node-telegram-bot-api'); // Parse the JSON key from the environment variable const keyJson = JSON.parse(process.env.GOOGLE_SHEET_KEY_JSON); @@ -20,11 +19,6 @@ const spreadsheetId = process.env.SPREADSHEET_ID; // Use environment variable fo const clearRange = 'E-Purchasing!A:AK'; // Range to clear const updateRange = 'E-Purchasing!A1'; // Range to update -// Telegram Bot setup -const botToken = process.env.TELEGRAM_BOT_TOKEN; // Telegram bot token -const chatId = process.env.TELEGRAM_CHAT_ID; // Telegram chat ID where messages will be sent -const bot = new TelegramBot(botToken, { polling: false }); // Set polling to false as we are just sending messages - async function fetchData() { try { // Fetch data from the URL @@ -63,17 +57,9 @@ async function fetchData() { }); console.log('Data successfully written to Google Sheets', result.data); - - // Send success message to Telegram - const successMessage = `✅ Data E-Purchasing successfully written to Google Sheets. Updated rows: ${rows.length}`; - await bot.sendMessage(chatId, successMessage); } catch (error) { console.error('Error:', error.response ? error.response.data : error.message); - - // Send error message to Telegram - const errorMessage = `❌ Error: ${error.response ? error.response.data : error.message}`; - await bot.sendMessage(chatId, errorMessage); } } -fetchData(); +fetchData(); \ No newline at end of file diff --git a/InstansiSatker.js b/InstansiSatker.js index 74d441e..15b3c81 100644 --- a/InstansiSatker.js +++ b/InstansiSatker.js @@ -1,6 +1,5 @@ const axios = require('axios'); const { google } = require('googleapis'); -const TelegramBot = require('node-telegram-bot-api'); // Parse the JSON key from the environment variable const keyJson = JSON.parse(process.env.GOOGLE_SHEET_KEY_JSON); @@ -20,11 +19,6 @@ const spreadsheetId = process.env.SPREADSHEET_ID; // Use environment variable fo const clearRange = 'Satker!A:AK'; // Range to clear const updateRange = 'Satker!A1'; // Range to update -// Telegram Bot setup -const botToken = process.env.TELEGRAM_BOT_TOKEN; // Telegram bot token -const chatId = process.env.TELEGRAM_CHAT_ID; // Telegram chat ID where messages will be sent -const bot = new TelegramBot(botToken, { polling: false }); // Set polling to false as we are just sending messages - async function fetchData() { try { // Fetch data from the URL @@ -63,17 +57,9 @@ async function fetchData() { }); console.log('Data successfully written to Google Sheets', result.data); - - // Send success message to Telegram - const successMessage = `✅ Data Penyedia_Terumumkan successfully written to Google Sheets. Updated rows: ${rows.length}`; - await bot.sendMessage(chatId, successMessage); } catch (error) { console.error('Error:', error.response ? error.response.data : error.message); - - // Send error message to Telegram - const errorMessage = `❌ Error: ${error.response ? error.response.data : error.message}`; - await bot.sendMessage(chatId, errorMessage); } } -fetchData(); +fetchData(); \ No newline at end of file diff --git a/NonTender_Selesai.js b/NonTender_Selesai.js index b6284ff..497f3b4 100644 --- a/NonTender_Selesai.js +++ b/NonTender_Selesai.js @@ -1,6 +1,5 @@ const axios = require('axios'); const { google } = require('googleapis'); -const TelegramBot = require('node-telegram-bot-api'); // Parse the JSON key from the environment variable const keyJson = JSON.parse(process.env.GOOGLE_SHEET_KEY_JSON); @@ -20,11 +19,6 @@ const spreadsheetId = process.env.SPREADSHEET_ID; // Use environment variable fo const clearRange = 'NonTender!A:ZZ'; // Range to clear const updateRange = 'NonTender!A1'; // Range to update -// Telegram Bot setup -const botToken = process.env.TELEGRAM_BOT_TOKEN; // Telegram bot token -const chatId = process.env.TELEGRAM_CHAT_ID; // Telegram chat ID where messages will be sent -const bot = new TelegramBot(botToken, { polling: false }); // Set polling to false as we are just sending messages - async function fetchData() { try { // Fetch data from the URL @@ -63,17 +57,9 @@ async function fetchData() { }); console.log('Data successfully written to Google Sheets', result.data); - - // Send success message to Telegram - const successMessage = `✅ Data NonTender_Selesai successfully written to Google Sheets. Updated rows: ${rows.length}`; - await bot.sendMessage(chatId, successMessage); } catch (error) { console.error('Error:', error.response ? error.response.data : error.message); - - // Send error message to Telegram - const errorMessage = `❌ Error: ${error.response ? error.response.data : error.message}`; - await bot.sendMessage(chatId, errorMessage); } } -fetchData(); +fetchData(); \ No newline at end of file diff --git a/Pencatatan_NonTender.js b/Pencatatan_NonTender.js index 1086db6..1977d0a 100644 --- a/Pencatatan_NonTender.js +++ b/Pencatatan_NonTender.js @@ -1,6 +1,5 @@ const axios = require('axios'); const { google } = require('googleapis'); -const TelegramBot = require('node-telegram-bot-api'); // Parse the JSON key from the environment variable const keyJson = JSON.parse(process.env.GOOGLE_SHEET_KEY_JSON); @@ -20,11 +19,6 @@ const spreadsheetId = process.env.SPREADSHEET_ID; // Use environment variable fo const clearRange = 'Pen NonTender!A:ZZ'; // Range to clear const updateRange = 'Pen Nontender!A1'; // Range to update -// Telegram Bot setup -const botToken = process.env.TELEGRAM_BOT_TOKEN; // Telegram bot token -const chatId = process.env.TELEGRAM_CHAT_ID; // Telegram chat ID where messages will be sent -const bot = new TelegramBot(botToken, { polling: false }); // Set polling to false as we are just sending messages - async function fetchData() { try { // Fetch data from the URL @@ -63,18 +57,9 @@ async function fetchData() { }); console.log('Data successfully written to Google Sheets', result.data); - - // Send success message to Telegram - const successMessage = `✅ Data Pencatatan_NonTender successfully written to Google Sheets. Updated rows: ${rows.length}`; - await bot.sendMessage(chatId, successMessage); } catch (error) { console.error('Error:', error.response ? error.response.data : error.message); - - // Send error message to Telegram - const errorMessage = `❌ Error: ${error.response ? error.response.data : error.message}`; - await bot.sendMessage(chatId, errorMessage); } } -fetchData(); - +fetchData(); \ No newline at end of file diff --git a/Pencatatan_Swakelola.js b/Pencatatan_Swakelola.js index c9f5a36..da06723 100644 --- a/Pencatatan_Swakelola.js +++ b/Pencatatan_Swakelola.js @@ -1,6 +1,5 @@ const axios = require('axios'); const { google } = require('googleapis'); -const TelegramBot = require('node-telegram-bot-api'); // Parse the JSON key from the environment variable const keyJson = JSON.parse(process.env.GOOGLE_SHEET_KEY_JSON); @@ -20,11 +19,6 @@ const spreadsheetId = process.env.SPREADSHEET_ID; // Use environment variable fo const clearRange = 'Pen Swakelola!A:ZZ'; // Range to clear const updateRange = 'Pen Swakelola!A1'; // Range to update -// Telegram Bot setup -const botToken = process.env.TELEGRAM_BOT_TOKEN; // Telegram bot token -const chatId = process.env.TELEGRAM_CHAT_ID; // Telegram chat ID where messages will be sent -const bot = new TelegramBot(botToken, { polling: false }); // Set polling to false as we are just sending messages - async function fetchData() { try { // Fetch data from the URL @@ -63,17 +57,9 @@ async function fetchData() { }); console.log('Data successfully written to Google Sheets', result.data); - - // Send success message to Telegram - const successMessage = `✅ Data Pencatatatn_Swakelola successfully written to Google Sheets. Updated rows: ${rows.length}`; - await bot.sendMessage(chatId, successMessage); } catch (error) { console.error('Error:', error.response ? error.response.data : error.message); - - // Send error message to Telegram - const errorMessage = `❌ Error: ${error.response ? error.response.data : error.message}`; - await bot.sendMessage(chatId, errorMessage); } } -fetchData(); +fetchData(); \ No newline at end of file diff --git a/Penyedia_Terumumkan.js b/Penyedia_Terumumkan.js index 23ff1d2..a68ccd8 100644 --- a/Penyedia_Terumumkan.js +++ b/Penyedia_Terumumkan.js @@ -1,6 +1,5 @@ const axios = require('axios'); const { google } = require('googleapis'); -const TelegramBot = require('node-telegram-bot-api'); // Parse the JSON key from the environment variable const keyJson = JSON.parse(process.env.GOOGLE_SHEET_KEY_JSON); @@ -20,11 +19,6 @@ const spreadsheetId = process.env.SPREADSHEET_ID; // Use environment variable fo const clearRange = 'Penyedia!A:ZZ'; // Range to clear const updateRange = 'Penyedia!A1'; // Range to update -// Telegram Bot setup -const botToken = process.env.TELEGRAM_BOT_TOKEN; // Telegram bot token -const chatId = process.env.TELEGRAM_CHAT_ID; // Telegram chat ID where messages will be sent -const bot = new TelegramBot(botToken, { polling: false }); // Set polling to false as we are just sending messages - async function fetchData() { try { // Fetch data from the URL @@ -63,17 +57,9 @@ async function fetchData() { }); console.log('Data successfully written to Google Sheets', result.data); - - // Send success message to Telegram - const successMessage = `✅ Data Penyedia_Terumumkan successfully written to Google Sheets. Updated rows: ${rows.length}`; - await bot.sendMessage(chatId, successMessage); } catch (error) { console.error('Error:', error.response ? error.response.data : error.message); - - // Send error message to Telegram - const errorMessage = `❌ Error: ${error.response ? error.response.data : error.message}`; - await bot.sendMessage(chatId, errorMessage); } } -fetchData(); +fetchData(); \ No newline at end of file diff --git a/Swakelola_Terumumkan.js b/Swakelola_Terumumkan.js index b79fabf..785f861 100644 --- a/Swakelola_Terumumkan.js +++ b/Swakelola_Terumumkan.js @@ -1,6 +1,5 @@ const axios = require('axios'); const { google } = require('googleapis'); -const TelegramBot = require('node-telegram-bot-api'); // Parse the JSON key from the environment variable const keyJson = JSON.parse(process.env.GOOGLE_SHEET_KEY_JSON); @@ -20,11 +19,6 @@ const spreadsheetId = process.env.SPREADSHEET_ID; // Use environment variable fo const clearRange = 'Swakelola!A:ZZ'; // Range to clear const updateRange = 'Swakelola!A1'; // Range to update -// Telegram Bot setup -const botToken = process.env.TELEGRAM_BOT_TOKEN; // Telegram bot token -const chatId = process.env.TELEGRAM_CHAT_ID; // Telegram chat ID where messages will be sent -const bot = new TelegramBot(botToken, { polling: false }); // Set polling to false as we are just sending messages - async function fetchData() { try { // Fetch data from the URL @@ -63,17 +57,9 @@ async function fetchData() { }); console.log('Data successfully written to Google Sheets', result.data); - - // Send success message to Telegram - const successMessage = `✅ Data Swakelola_Terumumkan successfully written to Google Sheets. Updated rows: ${rows.length}`; - await bot.sendMessage(chatId, successMessage); } catch (error) { console.error('Error:', error.response ? error.response.data : error.message); - - // Send error message to Telegram - const errorMessage = `❌ Error: ${error.response ? error.response.data : error.message}`; - await bot.sendMessage(chatId, errorMessage); } } -fetchData(); +fetchData(); \ No newline at end of file diff --git a/Tender_Selesai.js b/Tender_Selesai.js index d7f184e..dcc5a15 100644 --- a/Tender_Selesai.js +++ b/Tender_Selesai.js @@ -1,6 +1,5 @@ const axios = require('axios'); const { google } = require('googleapis'); -const TelegramBot = require('node-telegram-bot-api'); // Parse the JSON key from the environment variable const keyJson = JSON.parse(process.env.GOOGLE_SHEET_KEY_JSON); @@ -20,11 +19,6 @@ const spreadsheetId = process.env.SPREADSHEET_ID; // Use environment variable fo const clearRange = 'Tender!A:ZZ'; // Range to clear const updateRange = 'Tender!A1'; // Range to update -// Telegram Bot setup -const botToken = process.env.TELEGRAM_BOT_TOKEN; // Telegram bot token -const chatId = process.env.TELEGRAM_CHAT_ID; // Telegram chat ID where messages will be sent -const bot = new TelegramBot(botToken, { polling: false }); // Set polling to false as we are just sending messages - async function fetchData() { try { // Fetch data from the URL @@ -63,17 +57,9 @@ async function fetchData() { }); console.log('Data successfully written to Google Sheets', result.data); - - // Send success message to Telegram - const successMessage = `✅ Data Tender_Selesai successfully written to Google Sheets. Updated rows: ${rows.length}`; - await bot.sendMessage(chatId, successMessage); } catch (error) { console.error('Error:', error.response ? error.response.data : error.message); - - // Send error message to Telegram - const errorMessage = `❌ Error: ${error.response ? error.response.data : error.message}`; - await bot.sendMessage(chatId, errorMessage); } } -fetchData(); +fetchData(); \ No newline at end of file diff --git a/Tender_Selesai_Nilai.js b/Tender_Selesai_Nilai.js index 5c639ed..3748bc8 100644 --- a/Tender_Selesai_Nilai.js +++ b/Tender_Selesai_Nilai.js @@ -1,7 +1,5 @@ const axios = require('axios'); const { google } = require('googleapis'); -const TelegramBot = require('node-telegram-bot-api'); - // Parse the JSON key from the environment variable const keyJson = JSON.parse(process.env.GOOGLE_SHEET_KEY_JSON); @@ -20,11 +18,6 @@ const spreadsheetId = process.env.SPREADSHEET_ID; // Use environment variable fo const clearRange = 'TenderNilai!A:Z'; // Range to clear const updateRange = 'TenderNilai!A:Z'; // Range to update -// Telegram Bot setup -const botToken = process.env.TELEGRAM_BOT_TOKEN; // Telegram bot token -const chatId = process.env.TELEGRAM_CHAT_ID; // Telegram chat ID where messages will be sent -const bot = new TelegramBot(botToken, { polling: false }); // Set polling to false as we are just sending messages - async function fetchData() { try { // Fetch data from the URL @@ -63,16 +56,8 @@ async function fetchData() { }); console.log('Data successfully written to Google Sheets', result.data); - - // Send success message to Telegram - const successMessage = `✅ Data Tender_Selesai_Nilai successfully written to Google Sheets. Updated rows: ${rows.length}`; - await bot.sendMessage(chatId, successMessage); } catch (error) { console.error('Error:', error.response ? error.response.data : error.message); - - // Send error message to Telegram - const errorMessage = `❌ Error: ${error.response ? error.response.data : error.message}`; - await bot.sendMessage(chatId, errorMessage); } } diff --git a/Tender_Selesai_Pengumuman.js b/Tender_Selesai_Pengumuman.js index 424349e..640c8ec 100644 --- a/Tender_Selesai_Pengumuman.js +++ b/Tender_Selesai_Pengumuman.js @@ -12,8 +12,7 @@ const auth = new google.auth.GoogleAuth({ const sheets = google.sheets({ version: 'v4', auth }); // URL to fetch data from -const url = process.env.API_URL_TSP -; // Use environment variable for URL +const url = process.env.API_URL_TSP; // Use environment variable for URL // Define the spreadsheet ID and range const spreadsheetId = process.env.SPREADSHEET_ID; // Use environment variable for Spreadsheet ID @@ -63,4 +62,4 @@ async function fetchData() { } } -fetchData(); +fetchData(); \ No newline at end of file diff --git a/TokoDaring.js b/TokoDaring.js index cfe635f..83da3ff 100644 --- a/TokoDaring.js +++ b/TokoDaring.js @@ -1,6 +1,5 @@ const axios = require('axios'); const { google } = require('googleapis'); -const TelegramBot = require('node-telegram-bot-api'); // Parse the JSON key from the environment variable const keyJson = JSON.parse(process.env.GOOGLE_SHEET_KEY_JSON); @@ -20,11 +19,6 @@ const spreadsheetId = process.env.SPREADSHEET_ID; // Use environment variable fo const clearRange = 'TokoDaring!A:ZZ'; // Range to clear const updateRange = 'TokoDaring!A1'; // Range to update -// Telegram Bot setup -const botToken = process.env.TELEGRAM_BOT_TOKEN; // Telegram bot token -const chatId = process.env.TELEGRAM_CHAT_ID; // Telegram chat ID where messages will be sent -const bot = new TelegramBot(botToken, { polling: false }); // Set polling to false as we are just sending messages - async function fetchData() { try { // Fetch data from the URL @@ -63,16 +57,8 @@ async function fetchData() { }); console.log('Data successfully written to Google Sheets', result.data); - - // Send success message to Telegram - const successMessage = `✅ Data TokoDaring successfully written to Google Sheets. Updated rows: ${rows.length}`; - await bot.sendMessage(chatId, successMessage); } catch (error) { console.error('Error:', error.response ? error.response.data : error.message); - - // Send error message to Telegram - const errorMessage = `❌ Error: ${error.response ? error.response.data : error.message}`; - await bot.sendMessage(chatId, errorMessage); } }