Last active
July 4, 2024 09:37
-
-
Save garrytrinder/6e0629dcccfd135f6917ee2eb9b2fb26 to your computer and use it in GitHub Desktop.
Remove all bots from dev.botframework.com
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
// Remove all bots from your account | |
// 1. Go to https://dev.botframework.com/bots | |
// 2. Open the console (F12) | |
// 3. Paste the following code and press enter | |
(async () => { | |
// select the first bot element | |
let bot = document.querySelector('.bot-content > a'); | |
while (bot) { | |
// click the element link | |
bot.click(); | |
await new Promise(resolve => setTimeout(resolve, 3000)); | |
// click the settings tab | |
document.querySelectorAll('.bot-tab-control-tab')[5].click(); | |
document.querySelector('.delete-button').click(); | |
document.querySelector('.ok-button').click(); | |
await new Promise(resolve => setTimeout(resolve, 3000)); | |
// click OK in the confirmation dialog | |
document.querySelector('.ok-button').click(); | |
await new Promise(resolve => setTimeout(resolve, 200)); | |
// sometimes there is a second confirmation dialog about unsaved changes | |
const yes = document.querySelector('.ok-button'); | |
if (yes) { yes.click() } | |
await new Promise(resolve => setTimeout(resolve, 3000)); | |
// select the next bot | |
bot = document.querySelector('.bot-content > a'); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sometimes it fails but this is a good script, thanks