I have this url. Which basically sends a message in telegram with a bot when you paste it in the browser.
https://api.telegram.org/botsomeKEY/sendMessage?chat_id=-someID&text= TEST
My problem is that it is not letting me deploy this function and is giving me an error of "Function failed on loading user code. This is likely due to a bug in the user code".
export const sendMessage = functions.pubsub
.schedule("every 1 minutes") // run everyday "0 0 * * *" or every 1 minutes
.timeZone("America/Chicago")
.onRun((context) => {
const xhr = new XMLHttpRequest();
xhr.open("POST", httpAddress, true);
xhr.setRequestHeader("Content-Type", "application/json");
return xhr.send(JSON.stringify({
text: "TEST",
}));
});