Skip to content

Instantly share code, notes, and snippets.

@jarodsim
Created November 24, 2022 00:18
Show Gist options
  • Save jarodsim/43f2666b757984096a224fd9950739fb to your computer and use it in GitHub Desktop.
Save jarodsim/43f2666b757984096a224fd9950739fb to your computer and use it in GitHub Desktop.
Script para automagicamente responder mensagens no chat do google meet
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