Last active
March 9, 2018 20:28
-
-
Save Jul10l1r4/cb61deb49dbc54087fcd40d4da41b25f to your computer and use it in GitHub Desktop.
Função responsável por enviar mensagens ao telegram. ao bot :i
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fetch( `https://api.telegram.org/bot540137695:AAFO9tHLngrkve3mHN7QHdzmWyJs_O8-x3k/sendMessage?chat_id=469669662&text=Hello%20World` ) | |
.then(function(resposta) { | |
return resposta.text() // Transformando a resposta em texto | |
.then(function(text) { | |
let t = JSON.parse(text); | |
let uhul = t.ok === false | |
? `Oops, infelizmente houve um erro` | |
: 'Mensagem enviada ^^'; | |
console.log(`${uhul}`); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment