Last active
July 14, 2026 11:56
-
-
Save dytroc/c39645319e2b5681241c0c2286b165ca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Base code: https://gist.github.com/aamiaa/7cdd590e3949cd654758bc90bcb4710b | |
| let wpRequire = webpackChunkdiscord_developers.push([[Symbol()], {}, r => r]); | |
| webpackChunkdiscord_developers.pop(); | |
| let ApexStore = Object.values(wpRequire.c).find(x => x?.exports?.A?.createOverride).exports.A; | |
| let UserStore = Object.values(wpRequire.c).find(x => x?.exports?.A?.__proto__?.getCurrentUser).exports.A; | |
| let FluxDispatcher = Object.values(wpRequire.c).find(x => x?.exports?.A?.__proto__?.flushWaitQueue).exports.A; | |
| let api = Object.values(wpRequire.c).find(x => x?.exports?.Bo?.get).exports.Bo; | |
| let globalCopy = navigator.userAgent.includes("Firefox") ? navigator.clipboard.writeText.bind(navigator.clipboard) : copy | |
| const sleep = ms => new Promise(resolve => setTimeout(resolve, ms)) | |
| const userId = UserStore.getCurrentUser().id | |
| console.log("[Widget Creator] 앱 생성 중... 캡챠가 있다면 풀어주세요") | |
| const appRes = await api.post({ url: "/applications", body: { name: "DJMAX RESPECT V", team_id: null } }) | |
| FluxDispatcher.dispatch({ type: "APPLICATION_CREATE_SUCCESS", application: appRes.body }) | |
| const appId = appRes.body.id | |
| console.log("[Widget Creator] Social SDK 활성화 중...") | |
| await api.post({ url: `/applications/${appId}/social-sdk/enable`, body: { "name": "a", "business_email": "foo@bar.com", "game_or_studio_name": "a", "game_or_studio_url": "", "email_updates_consent": false, "country_or_region": "United States", "title_role": "Founder", "target_platforms": [], "form_type": "Dev Solutions", "sfdc_leadsource": "Dev Portal", "utm_campaign": "SDK Enable Form" } }) | |
| console.log("[Widget Creator] 위젯 만드는 중...") | |
| const configRes = await api.post({ url: `/applications/${appId}/widget-configs`, body: { display_name: "DJMAX RESPECT V" } }) | |
| const configId = configRes.body.config_id | |
| await api.patch({ url: `/applications/${appId}/widget-configs/${configId}`, body: {"surfaces":{"widget_bottom":{"layout": "widget_bottom_stats", "components":{"stat_5":{"fields":{"value":{"value_type": "data", "presentation_type": "text", "value": "tierpoints" }, "label":{"value_type": "custom_string", "presentation_type": "text", "value": "티어 포인트" } } }, "stat_6":{"fields":{"value":{"value_type": "data", "presentation_type": "text", "value": "djclass" }, "label":{"value_type": "custom_string", "presentation_type": "text", "value": "DJ Class" } } }, "stat_3":{"fields":{"value":{"value_type": "data", "presentation_type": "text", "value": "maxcombo" }, "label":{"value_type": "custom_string", "presentation_type": "text", "value": "맥스 콤보 수" } } }, "stat_2":{"fields":{"value":{"value_type": "data", "presentation_type": "text", "value": "perfect" }, "label":{"value_type": "custom_string", "presentation_type": "text", "value": "퍼펙트 패턴 수" } } }, "stat_4":{"fields":{"value":{"value_type": "data", "presentation_type": "text", "value": "avgrate" }, "label":{"value_type": "custom_string", "presentation_type": "text", "value": "평균 정확도" } } }, "stat_1":{"fields":{"value":{"value_type": "data", "presentation_type": "text", "value": "clears" }, "label":{"value_type": "custom_string", "presentation_type": "text", "value": "클리어 패턴 수" } } } } }, "mini_profile":{"layout": "mini_profile_contained_stat", "components":{"stat":{"fields":{"text":{"value_type": "data", "presentation_type": "text", "value": "djclass" } } }, "contained_image":{"fields":{"image":{"value_type": "data", "presentation_type": "image", "value": "icon" } } } } }, "widget_top":{"layout": "widget_top_contained", "components":{"contained_image":{"fields":{"image":{"value_type": "data", "presentation_type": "image", "value": "icon" } } }, "title":{"fields":{"text":{"value_type": "data", "presentation_type": "text", "value": "username" } } }, "subtitle_1":{"fields":{"text":{"value_type": "data", "presentation_type": "text", "value": "button", "fallback":{"value_type": "custom_string", "presentation_type": "text", "value": "4B" } }, "label":{"value_type": "custom_string", "presentation_type": "text", "value": "버튼" } } }, "subtitle_2":{"fields":{"text":{"value_type": "custom_string", "presentation_type": "text", "value": "[V-ARCHIVE 기준]" } } } } }, "add_widget_preview":{"layout": "add_widget_preview_contained", "components":{"contained_image":{"fields":{"image":{"value_type": "data", "presentation_type": "image", "value": "icon" } } } } } } } }) | |
| await api.post({ url: `/applications/${appId}/widget-configs/${configId}/publish` }) | |
| console.log("[Widget Creator] 프로필에 위젯 추가 중...") | |
| await api.patch({ url: `/applications/${appId}`, body: { redirect_uris: ["https://discord.com"] } }) | |
| await api.post({ url: `/oauth2/authorize?client_id=${appId}&response_type=token&scope=sdk.social_layer_presence`, body: { authorize: true } }) | |
| const profileRes = await api.get({ url: `/users/${userId}/profile` }) | |
| const existingWidgets = profileRes.body.widgets | |
| existingWidgets.unshift({ "data": { "type": "application", "application_id": appId } }) | |
| await api.put({ url: `/users/@me/widgets`, body: { "widgets": existingWidgets } }) | |
| console.log("[Widget Creator] 토큰 구하는 중... 2FA 요청시 풀어주세요") | |
| const botTokenRes = await api.post({ url: `/applications/${appId}/bot/reset` }) | |
| const botToken = botTokenRes.body.token; | |
| globalCopy( | |
| `{ | |
| "app": "${appId}", | |
| "user": "${userId}", | |
| "token": "${botToken}" | |
| }`) | |
| console.log("[Widget Creator] 수정 콘피그가 복사됐습니다.") | |
| ApexStore.createOverride("2026-03-widget-config-editor", 1) | |
| document.querySelector(`a[href="/developers/applications/${appId}"]`).click() | |
| while (!document.querySelector(`a[href="/developers/applications/${appId}/widget"]`)) { | |
| await sleep(100) | |
| } | |
| document.querySelector(`a[href="/developers/applications/${appId}/widget"]`).click() | |
| console.log("[Widget Creator] 위젯 수정하고 싶다면 해당 페이지에서 수정 가능합니다!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment