function addDiscordWidget(container) {
    if (container.querySelector('iframe.discord-widget')) return;

    const iframe = document.createElement('iframe');
    iframe.className = "discord-widget";
    iframe.src = "https://discord.com/widget?id=1364496348233072670&theme=dark";
    iframe.width = "350";
    iframe.height = "500";
    iframe.allowTransparency = true;
    iframe.frameBorder = "0";
    iframe.sandbox = "allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts";

    container.appendChild(iframe);
}

const observer = new MutationObserver((mutations, obs) => {
    const container = document.querySelector("#app > div > main > div.grid-wrapper > div.right-column");
    if (container) {
        addDiscordWidget(container);
        obs.disconnect();
    }
});

observer.observe(document.body, {
    childList: true,
    subtree: true
});