Last active
September 19, 2023 10:46
-
-
Save tehbasshunter/89d40b8dc70f9a2cb70caf3554199154 to your computer and use it in GitHub Desktop.
StreamElements Custom Bot Remover (Unofficial)
This file contains hidden or 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
| <br> | |
| <h style='font-weight: bold; font-size: 30px; color: navy'>SE.Live Custom Bot Remover</h> | |
| <p>This form will make an API to remove your custom bot name in SE.Live.</p> | |
| <p>Restart SE.Live for change to take affect. You will need to reconnect the custom bot.</p> | |
| <p><br>NOT OFFICIALLY SUPPORTED!!!</p> | |
| <a href='https://streamelements.com/dashboard/account/channels' target='_blank'>Get your info here: | |
| <br> | |
| <img src='https://streamelements.is-serious.business/u1MgMMa.jpg'> | |
| </a> | |
| <hr> | |
| <div id='inputs'> | |
| <form action="/action_page.php"> | |
| <img src='https://upload.wikimedia.org/wikipedia/commons/thumb/4/4e/Eo_circle_red_white_number-1.svg/1024px-Eo_circle_red_white_number-1.svg.png' height='30px'> | |
| <label>SE Account ID:</label><br> | |
| <input type='text' id='inputId' size='25' value='5961_example_SE_ID_95c9'><br><br> | |
| <img src='https://upload.wikimedia.org/wikipedia/commons/thumb/8/85/Eo_circle_red_white_number-2.svg/1200px-Eo_circle_red_white_number-2.svg.png' height='30px'> | |
| <label>SE JWT:</label><br> | |
| <input type='text' id='inputToken' size='50'><br><br> | |
| <hr><br> | |
| <button id='doTheThing' style='background-color: darkorchid; padding: 15px'>Do Thing π</button> | |
| </form> | |
| <br> | |
| </div> | |
| <div id='logs' style='color: maroon; font-weight: bold'></div> | |
| <script> | |
| let inputId, inputToken, warningCount = 0, warningTimer, userCount = 0; | |
| document.getElementById('doTheThing').addEventListener('click', e => { | |
| e.preventDefault(); | |
| if(warningCount < 1) { | |
| warningCount++; | |
| document.getElementById("doTheThing").innerText = 'Are You Sure?'; | |
| warningTimer = setTimeout(_=> { | |
| warningCount = 0; | |
| document.getElementById("doTheThing").innerText = 'Do Thing π'; | |
| }, 2000); | |
| return; | |
| }; | |
| clearTimeout(warningTimer); | |
| document.getElementById("doTheThing").innerText = 'Do Thing π?'; | |
| warningCount = 0; | |
| inputId = document.getElementById("inputId").value; | |
| inputToken = document.getElementById("inputToken").value; | |
| if(inputId.length !== 24) return basicErrorCheck('Error: Input ID is not 24 characters.'); | |
| if(inputToken.length < 300) return basicErrorCheck('Error: JWT Token is too short.'); | |
| document.getElementById("doTheThing").style.display = "none"; | |
| document.getElementById("logs").innerText = 'Fixing...' | |
| fixBotName(); | |
| }); | |
| function basicErrorCheck(e){ | |
| console.log(e); | |
| document.getElementById("logs").innerText = e; | |
| }; | |
| function fixBotName() { | |
| fetch(`https://api.streamelements.com/kappa/v2/integrations/${inputId}/custom-bot/disconnect`, { | |
| "method": "POST", | |
| "headers": { | |
| "Authorization": `Bearer ${inputToken}` | |
| }, | |
| }) | |
| .then(response => response.json()) | |
| .then(data => { | |
| console.log('data: ', data); | |
| if (data.error) throw new Error(`${data.error}, ${data.message}`); | |
| else basicErrorCheck('Done π Reload SE.Live.'); | |
| }) | |
| .catch(e => { | |
| basicErrorCheck(e) | |
| document.getElementById("doTheThing").style.display = "block"; | |
| }); | |
| }; | |
| </script> | |
| <style>* { | |
| color: ivory; | |
| background-color: gray; | |
| font-size: 16px; | |
| } | |
| </style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment