konnokai GitHub avatar

DiscordWidgetsV2Bot

konnokai

A Discord bot that lets application owners customize their Widgets V2 profile fields via slash commands, using an undocumented API endpoint.

Stars

17

7-day growth

No data

Forks

0

Open issues

0

License

MIT

Last updated

2026-07-05

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

It automates a previously manual process of editing Discord profile widgets through a user-installable bot, complete with a Tampermonkey script to enable the experimental widget editor in Developer Portal.

Who it is for

  • Discord application developers experimenting with Social SDK Widgets V2
  • Developers who want to customize their Discord profile with dynamic fields
  • Twitch streamers who want to auto-update their Discord profile when live
  • C# developers interested in Discord.Net and undocumented API integration

Use cases

  • Set custom text or images on your Discord profile's widget top, bottom, and mini-profile sections
  • Automatically update a profile field to show Twitch streaming status
  • Quickly test or prototype Widgets V2 features without manually editing the API payload
  • Use as a reference for building similar bots that interact with undocumented Discord endpoints

Strengths

  • Commands are automatically generated from enum definitions, making field addition or modification trivial
  • Twitch integration polls every 30 seconds and only pushes on state change, reducing unnecessary API calls
  • Includes a Tampermonkey script to automatically enable the experimental widget editor in Developer Portal
  • Supports both local execution via .NET and Docker deployment with persistent JSON storage

Considerations

  • Relies on an undocumented API endpoint that Discord may change or remove at any time
  • After June 4, 2026, only the application owner can add widgets to their profile, severely limiting usage
  • Setup requires numerous manual steps in Developer Portal and client-side console commands, which may be error-prone

README quick start

DiscordWidgetsV2Bot

讓 Discord application 擁有者透過 /widget slash command 自訂個人檔案上的「Widgets V2」小工具內容。C# / Discord.Net,user-install bot,資料以 JSON 檔持久化。

⚠️ Widgets V2 是 Social SDK 的實驗功能,本 bot 呼叫的是未文件化端點,Discord 可能隨時變更。且 2026/6/4 起僅 application 擁有者能把 widget 加到自己的個人檔案。

運作方式

PATCH https://discord.com/api/v9/applications/{appId}/users/{userId}/identities/0/profile
Body: { "data": { "dynamic": [
  { "type": 1, "name": "top-title", "value": "字串" },
  { "type": 3, "name": "top-image", "value": { "url": "https://..." } } ] } }

name 對應 Developer Portal widget 編輯器中設定的 Data Field 名稱(type 1=字串、2=數值、3=圖片)。欄位定義集中在 WidgetService.csStringField / ImageField enum([ChoiceDisplay] 即 API 欄位名),指令選項自動由 enum 產生,改欄位只需要動 enum。

欄位一覽(共 19 個,需與 widget 編輯器的 Data Field 名稱一致)

區塊字串欄位(type 1)圖片欄位(type 3)
Widget Toptop-titletop-sub-title-1top-imagetop-sub-icon-1
Widget Bottom(項目 1–4)bottom-name-Nbottom-description-Nbottom-image-N
Mini Profilemini-profile-stat-textmini-profile-stat-iconmini-profile-contained-image

前置步驟(Developer Portal / Discord 客戶端手動操作)

  1. 建立應用程式 → 遊戲 → Social SDK 填表啟用
  2. 啟用 Widget 編輯頁 (可安裝 油猴腳本 自動套用,或手動在 Developer Portal 的 DevTools console 執行腳本)

DevTools console 腳本

let _mods = webpackChunkdiscord_developers.push([[Symbol()],{},r=>r.c]);
webpackChunkdiscord_developers.pop();

let findByProps = (...props) => {
    for (let m of Object.values(_mods)) {
        try {
            if (!m.exports || m.exports === window) continue;
            if (props.every((x) => m.exports?.[x])) return m.exports;

            for (let ex in m.exports) {
                if (props.every((x) => m.exports?.[ex]?.[x]) && m.exports[ex][Symbol.toStringTag] !== 'IntlMessagesProxy') return m.exports[ex];
            }
        } catch {}
    }
}

findByProps("getAll").getAll().find(e=>e.getName() === "ApexExperimentStore").createOverride("2026-03-widget-config-editor", 1)

(跑完腳本後記得點左上角的倒退箭頭再重新點到你的應用程式頁面,切記不可重整頁面,不然腳本會被覆寫)

  1. 開啟 Widget 編輯頁並建立欄位(User Data 型別,名稱須與本專案欄位一致)、設定 fallback 避免忘記設定導致欄位空白,保存後記得發布
  2. OAuth2 頁設定 redirect URI (重新導向) 為 https://discord.com 後保存
  3. OAuth2 URL 產生器 → 勾選 openid 以及 sdk.social_layer選擇重新導向的 URI 選擇剛剛設定的重新導向網址(應該要是 https://discord.com
  4. 複製產生的 URL,將 URL 中的 `response_type

Related repositories

Similar projects matched by category, topics, and programming language.

TryCaspian
TryCaspian GitHub avatar

caspian-sdk

Caspian is an open-source SDK and gateway that lets AI agents communicate across multiple channels (Slack, Discord, Telegram, email, etc.) through a single handler, eliminating per-channel adapter code.

Python
274
GravelElementalist
GravelElementalist GitHub avatar

Discord-Zapret

A Windows tool that uses WinDivert and zapret strategies to bypass DPI censorship for Discord, YouTube, Telegram, and other online services.

Batchfile
9
CennoxX
CennoxX GitHub avatar

WidgetRelay

WidgetRelay is a Tasker plugin that reads text and JSON from Android home screen widgets and can click their elements, all without a launcher.

Mobile
6