Created
October 5, 2019 16:00
-
-
Save AlbericoD/471e11dd71eca13918c700e7ddfb125a to your computer and use it in GitHub Desktop.
passo 3
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
//intercepta mensagem do chat | |
function mensagemChegou(alvo, contexto, mensagem, ehBot) { | |
if (ehBot) { | |
return; //se for mensagens do nosso bot ele não faz nada | |
} | |
const nomeDoComando = mensagem.trim();// remove espaço em branco da mensagem para verificar o comando | |
// checando o nosso comando | |
if (nomeDoComando === '!comandoUM') { | |
console.log(`* Foi Executado o comando ${nomeDoComando}`); | |
} else if (nomeDoComando === '!comandoDOIS') { | |
console.log(`* Foi Executado o comando ${nomeDoComando}`); | |
} else { | |
console.log(`* Não conheço o comando ${commandName}`); | |
} | |
} | |
function entrouNoChatDaTwitch(endereco, porta) { | |
console.log(`* Bot entrou no endereço ${endereco}:${porta}`); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment