mirror of
https://github.com/Myxelium/RandomMemerBot.git
synced 2026-04-13 10:30:36 +00:00
Added join button for manully triggering the bot
This commit is contained in:
@@ -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())
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
<button type="submit" class="btn btn-primary btn-block">Upload</button>
|
||||
</form>
|
||||
|
||||
<button id="joinButton" class="btn btn-info btn-block">Join</button>
|
||||
|
||||
<div id="nextPlaybackTime" class="mb-4">
|
||||
Endpoint not loading!?
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user