How the Discord Status Works

If you inspect the source code of the main lander page, you'll notice tags like <DUserAPI>status</DUserAPI> right inside the HTML.

These aren't parsed by JavaScript on your browser. Instead, when a request hits the server, my Crystal backend intercepts the HTML payload on-the-fly, queries a discord bot that has an API for this, replaces those custom tags with my current live status and activity, and streams the compiled response back down.

Why Crystal? Because it's fast, compiled, has awesome concurrency, and because I felt like writing it that way.

You can find the raw index.html source here.

As for releasing the source crystal source code? Let's just say I'm too lazy for that right now.


← Back to the main page