Created
November 24, 2022 00:18
-
-
Save jarodsim/43f2666b757984096a224fd9950739fb to your computer and use it in GitHub Desktop.
Script para automagicamente responder mensagens no chat do google meet
This file contains 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
function handleMessages(filter) { | |
const valuesAlreadySent = [] | |
const interval = setInterval(() => { | |
if (valuesAlreadySent.length >= Object.keys(filter).length) { | |
clearInterval(interval) | |
return | |
} | |
const div_message = document.querySelectorAll('div[data-message-text]') | |
const textarea = document.getElementsByTagName('textarea')[0] | |
const button = document.getElementsByClassName('VfPpkd-Bz112c-LgbsSe yHy1rc eT1oJ QDwDD tWDL4c Cs0vCd')[0] | |
const words = Object.keys(filter) | |
div_message.forEach((div) => { | |
const message = div.dataset.messageText | |
if (words.includes(message) && !valuesAlreadySent.includes(message)) { | |
valuesAlreadySent.push(message) | |
textarea.value = filter[message] | |
button.removeAttribute("disabled") | |
button.click() | |
} | |
}) | |
}, 2000) | |
} | |
handleMessages({ | |
presente: "testeee", | |
ola: "olá, tudo bem?" | |
}) | |
// tambem disponível em: https://unipad.jarodmateus.com/meet |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment