Added join button for manully triggering the bot

This commit is contained in:
Myx
2023-10-18 21:53:12 +02:00
parent ba7d6aef1e
commit d1bffddd46
4 changed files with 28 additions and 2 deletions

View File

@@ -6,6 +6,25 @@ document.addEventListener('DOMContentLoaded', (event) => {
})
});
document.getElementById('joinButton').addEventListener('click', function() {
this.disabled = true;
fetch('/join')
.then(response => response.text())
.then(data => {
console.log(data);
setTimeout(() => {
this.disabled = false;
}, 40000);
})
.catch((error) => {
console.error('Error:', error);
setTimeout(() => {
this.disabled = false;
}, 1000);
});
});
function loadNextPlaybackTime() {
fetch('/nextplaybacktime')
.then(response => response.text())