i made some lil changes in the design and addet a few lines to let the egg connect with twitch chat so i can use it as overlay in OBS or similar programs...
/*************** Twitch Connection *********************/
const client = new tmi.Client({
options: { debug: true },
identity: {
username: 'YOUR-BOTNAME',
password: 'OAUTH:AAASSSDDDFFFXXX'
},
channels: [ 'YOUR-CHANNEL' ]
});
client.connect();
client.on('message', (channel, tags, message, self) => {
// What we want to happen when a comment occurs
console.log(`${tags['display-name']}: ${message}`);
if (message === '!food') {
// select the element by finding the id of food button
document.querySelector(".food1").click();
// say out loud.
client.say(channel, `Thanks ${tags['display-name']} for feeding the Bot!!!`);
}
if (message === '!pet') {
// select the element by finding the id of pet
document.querySelector(".pet").click();
// say out loud.
client.say(channel, `Thank you ${tags['display-name']} for Bot petting!!!`);
}
});
/************** Twitch Connection END *********************/
i found this and like it at the first view.
i made some lil changes in the design and addet a few lines to let the egg connect with twitch chat so i can use it as overlay in OBS or similar programs...
adding in the head of the "index.html"
<script src="https://github.com/tmijs/tmi.js/releases/download/v1.8.5/tmi.min.js"></script>
then i`ve addet in the "index.js"
maybe someone like ^^