I pressed every button on my own website
My Discord bot's dashboard has more buttons than I can keep in my head. So a script pressed all 1,730 of them and wrote down which ones did nothing. Almost all the answers were boring, and that was the point.
I have a Discord bot that sets up a whole server, and it has a website to manage it. The website grew fast. My biggest fear with it is simple: a button that does nothing. You press it, nothing moves, and you don’t know if it worked.
I can’t find those by reading code. The page has a click handler, the handler calls the server, the server has a matching action. All three can exist and the button can still be dead, because one line returns early.
So I stopped reading and let a script press everything.
What “did something” means
The hard part was deciding what counts. A press did something if any of these happened in the next third of a second:
- the page sent a request
- anything on the page changed (text, a class, a new element)
- a dialog opened
- the address changed
- something was copied, a file download started, a new window was asked for
- the focus moved or the page scrolled
The script runs the real site against a pretend Discord on my own PC. No real server is touched. It opens every page, every tab and every part of a tab, lists the buttons it can see, presses one, checks the list above, then draws the page again from nothing and presses the next.
It also listens for two louder things: an error thrown in the page, and an answer from the server that says “not found” or “unknown”.
The numbers
| Buttons pressed | 1,730 |
| Errors thrown in the page | 0 |
| “Not found” or “unknown” answers | 0 |
| Presses where nothing happened | 45 |
| Of those, real problems | 1 |
The 45 were almost all the same three things. A tab that was already open. A choice that was already picked. A question the browser itself asks, like “are you sure?”, which my script answers “no” to on purpose.
One was real. On the backups page, Open next to an empty code box did nothing at all. No message, no red border. Now it says “Type or paste a backup code first” and puts the cursor in the box.
One bug for 1,730 presses
That looks like a bad trade. I don’t think it is.
Before this, “every button works” was something I hoped. Now it’s a number I can get again in 25 minutes. The next time the site grows, the same script runs and the list is either empty or it isn’t.
The other thing I learned: a silent button is nearly always an early return on empty input. The code checks “is the box empty?” and leaves. Leaving is right. Leaving without a word is the bug.
If a button can refuse, it has to say why.