Or how we successfully launched an interactive Quiz with Discord roles attached to it, just to have it crash down because someone moved the bot role 4 spots down the list.
I volunteer for a women-only League of Legends community called Legión Lunari doing all sorts of stuff. My latest assignment has been this thing called “the ol’ Web Dev” and the team created a website for the community.
Then the anniversary came.
September is “Mes Lunari”, and we truly try to give our best in every regard. Last year the admins created this house system for the members to be sorted into and participate in activities.
And I mean, it worked, but it was very manual, and as any good (?) developer I don’t like manual things, so this year’s mission was to create an interactive, bespoke version of the personality quiz and then connect it to a Discord bot that automatically assigns each house’s role in the server.
Putting my nonexistent PM hat on for a sec and doing a retro on the development of the personality quiz: that went perfectly. My colleague is a really talented web developer and blew right past my (admittedly very high) expectations. Leadership also loved it so that’s a double yay from me.
But then we had to move onto the “connecting to discord” part, and that was a whole other story.
Maybe because I was involved (i.e. I was the main dev in this part), maybe because it was my first time interacting with Discord in any way programmatically, but everything felt to me like it took so long, even with some AI push.
Everything felt like an uphill battle that I was barely surviving through, but not really winning.
Not losing it either though, and after much battling I managed to get a successful test of the flows we wanted for this feature:
- Existing house affiliations get respected and migrated into the system
- New house affiliations are claimed correctly
- No one can switch houses after first assignment
So I was definitely excited to deploy this into the real server, and the wild west of the internet, confirm it worked there as well and then see it actually get used.
But of course my lack of Discord expertise wasn’t gonna let me off easy (as if it hadn’t fought me to the death already), and I ran into a wild, and completely unexpected and unexplainable, 500: Internal Server Error error that persisted through my best attempts at retrying the request without changing anything.
I mean, I did change some things: I added some logging to check I had all the right details there (without logging anything dangerous, I’m not that reckless), I even rotated the token with the appropriate permissions and removed then reintroduced the bot to the server, yet nothing.
With nothing to explain this error that I could find, I decided to use AI to explore the Discord docs to dig for a reason for this puzzling error.
The answer was immediate and, to me, insanely confusing. To assign roles in Discord, your automatically created bot role needs to be ABOVE the roles you want it to be able to assign. This setting is in the roles panel of EACH server you want the bot to work in.
And I guess this makes sense to people with more knowledge in Discord, but did I mention I know very little about Discord??
So this literal voodoo magic to me was, in the end, responsible for a dozen failed house roles assignments and an hour of focused panic. F U N!!
As a postmortem, this was an interesting learning process, I loves the result and it’s been quite a success with the community.
I definitely can’t wait to work on what’s next!