### Basic Discord.py-Self Example Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/README.md This is a basic example demonstrating how to set up and run a self-bot using the Discord.py-Self library. Ensure you have the library installed and your user token is kept private. ```python import discord client = discord.Client() @client.event async def on_ready(): print('We have logged in as {0.user}'.format(client)) client.run('YOUR_USER_TOKEN', bot=False) ``` -------------------------------- ### Get Stripe Setup Intents Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/internals/endpoints.md Retrieves Stripe setup intents for the user's billing. ```APIDOC ## GET /users/@me/billing/stripe/setup-intents ### Description Fetches Stripe setup intents required for payment processing. ### Method GET ### Endpoint /users/@me/billing/stripe/setup-intents ``` -------------------------------- ### Get All Experiments Across All Guilds Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/api-reference-guild-channel-operations.md A basic usage example demonstrating how to call `getAllGuildsExperiments` and log the entire result to the console. ```javascript // Get all experiments across all guilds const allExperiments = getAllGuildsExperiments(); console.log(allExperiments); ``` -------------------------------- ### Discord.JS-Pure Example Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/README.md This example demonstrates using Discord.JS-Pure, a self-bot wrapper that runs in the browser's inspect element console. It allows for client-side interactivity similar to client mods. ```javascript const Discord = require('discord.js-pure'); const client = new Discord.Client(); client.on('ready', () => { console.log(`Logged in as ${client.user.tag}!`); }); client.login('YOUR_USER_TOKEN'); ``` -------------------------------- ### Alert with Formatted Message Example Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/api-reference-modal-components.md This example demonstrates creating an alert modal with a description that includes Discord markdown formatting like code blocks. ```javascript // Alert with formatted message const result = await createAlertModal( "Execution Complete", "The operation completed successfully.\n\nStatus: `200 OK`\nTime taken: `1.5s`" ); ``` -------------------------------- ### Simple Markdown Examples Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/README.md Demonstrates various basic markdown formatting options available in Discord messages. ```markdown ~~ strikethrough text~~ ``` ```markdown ** bolded text** ``` ```markdown * italicized text (1)* ``` ```markdown _ italicized text (2)_ ``` ```markdown __ underlined text__ ``` ```markdown ` single-lined codeblock` ``` ```markdown ``` multi-lined codeblock ``` ``` ```markdown > single-lined quote ``` ```markdown >>> multi-lined quote ``` -------------------------------- ### Discord.JS-Selfbot-V13 Example Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/README.md An example of a self-bot using Discord.JS-Selfbot-V13. This snippet shows basic event handling and how to log in with a user token. Remember to keep your token secure. ```javascript const Discord = require('discord.js-selfbot-v13'); const client = new Discord.Client(); client.on('ready', async () => { console.log(`${client.user.username} is logged in!`); }); client.login('YOUR_USER_TOKEN'); ``` -------------------------------- ### Console Output Example for XHR Logging Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/api-reference-debugging-and-introspection.md When XHR logging is enabled, network requests are logged to the console with their event types and payloads. This example shows typical output formats. ```javascript // Typical payload structures "messageCreate" Object {events: [{type: "messageCreate", ...}]} "typingStart" Object {events: [{type: "typingStart", ...}]} "presenceUpdate" Object {events: [{type: "presenceUpdate", ...}]} "readStateUpdate" Object {events: [{type: "readStateUpdate", ...}]} "no_event_type" Object {} // Non-event requests ``` -------------------------------- ### Example Discord API Request URL Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/endpoints.md Provides a concrete example of a fully constructed URL for accessing the current authenticated user's data via the Discord API. ```plaintext https://discord.com/api/v9/users/@me ``` -------------------------------- ### Example: Log All Added Properties Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/api-reference-debugging-and-introspection.md Logs the keys of all custom properties found on the window object. This helps in quickly seeing what non-native scripts have added. ```javascript // Get all added properties const added = getAddedWindowValues(); console.log(Object.keys(added)); // Output: ["webpackChunkdiscord_app", "GLOBAL_ENV", "React", "ReactDOM", ...] ``` -------------------------------- ### Create Friend Invite with Async/Await Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/quick-reference.md An example of creating a friend invite using async/await syntax. It includes error handling for the asynchronous operation. ```javascript async function myScript() { try { const invite = await createFriendInvite(); console.log(invite.code); } catch (error) { console.error("Failed to create invite:", error); } } myScript(); ``` -------------------------------- ### Markdown Formatting Examples Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/api-reference-modal-components.md Examples of Discord Markdown syntax supported in the `descr` parameter for alert modals. Use these to format text within modals. ```markdown **Bold**: `**text**` ``` ```markdown **Italic**: `*text*` or `_text_` ``` ```markdown **Strikethrough**: `~~text~~` ``` ```markdown **Code**: `` `inline code` `` ``` ```markdown **Code blocks**: ` ```language\ncode\n``` ` ``` ```markdown **Links**: `[text](url)` ``` ```markdown **Quotes**: `> quoted text` ``` ```markdown **Lists**: `- item` or `1. numbered` ``` ```markdown **Mentions**: `<@userid>`, `<@&roleid>`, `<#channelid>` ``` ```markdown **Emoji**: `:emojiname:` or Unicode emoji ``` -------------------------------- ### Example: Find Specific Properties Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/api-reference-debugging-and-introspection.md Checks for and logs the 'GLOBAL_ENV' property if it exists on the window object. Useful for accessing Discord's configuration details. ```javascript // Find specific properties const added = getAddedWindowValues(); if (added.GLOBAL_ENV) { console.log("Discord config:", added.GLOBAL_ENV); } ``` -------------------------------- ### Simple Yes/No Confirmation Example Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/api-reference-modal-components.md Use this snippet for a basic yes/no confirmation dialog. The result indicates if the user confirmed the action. ```javascript // Simple yes/no confirmation const confirmed = await createAlertModal( "Delete Account?", "Are you sure you want to delete your account? **This cannot be undone.**" ); if (confirmed) { console.log("Account deleted"); } else { console.log("Deletion canceled"); } ``` -------------------------------- ### Get Users Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/internals/endpoints.md Retrieves a list of users. ```APIDOC ## GET /users ### Description Fetches a list of users. ### Method GET ### Endpoint /users ``` -------------------------------- ### Example: Check Library Availability Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/api-reference-debugging-and-introspection.md Verifies if React and ReactDOM are globally available by checking the properties returned by getAddedWindowValues. Useful for ensuring frontend libraries are loaded. ```javascript // Check what libraries are available const added = getAddedWindowValues(); if (added.React && added.ReactDOM) { console.log("React and ReactDOM are available globally"); } ``` -------------------------------- ### Re-enable Tracking Example Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/api-reference-debugging-and-introspection.md Demonstrates how to re-enable tracking after it has been disabled. This is useful for turning analytics and error reporting back on. ```javascript // Re-enable tracking toggleTracking(); trackingEnabled = true; ``` -------------------------------- ### Get Report Options Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/internals/endpoints.md Retrieves available options for creating reports. ```APIDOC ## GET /report/options ### Description Fetches the available categories or options for submitting a report. ### Method GET ### Endpoint /report/options ``` -------------------------------- ### Get Activities Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/internals/endpoints.md Retrieves information about user activities. ```APIDOC ## GET /activities ### Description Fetches general activity information. ### Method GET ### Endpoint /activities ``` -------------------------------- ### Get All Guild Experiments Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/snippets/README.md Retrieves all enabled experiments for every guild the user is a part of. This snippet also includes examples for finding guilds with the most experiments or a specific experiment. ```javascript let allGuildsWithTheirExperiments = getAllGuildsExperiments(); console.log(allGuildsWithTheirExperiments); /* you can also do the below to see the guild you're in with the most experiments: // BEGIN CODE let allGuildsWithTheirExperiments = getAllGuildsExperiments(); let mostExperiments = {guild: undefined, count: undefined, experiments: undefined}; for (let x in guildsWithExps) { if (typeof mostExperiments.count !== "undefined") { if (mostExperiments.count < Object.keys(guildsWithExps[x]).length) { mostExperiments.guild = x; mostExperiments.count = Object.keys(guildsWithExps[x]).length; mostExperiments.experiments = guildsWithExps[x]; } } else { mostExperiments.guild = x; mostExperiments.count = Object.keys(guildsWithExps[x]).length; mostExperiments.experiments = guildsWithExps[x]; } } console.log(mostExperiments.guild, mostExperiments.count, mostExperiments.experiments); // END CODE as well as the above, you can find every guild with a specific experiment (by experiment id) like so: // BEGIN CODE let allGuildsWithTheirExperiments = getAllGuildsExperiments(); let experimentId = "experiment id to find guilds with"; for (let x in guildsWithExps) { let guildExperiments = guildsWithExps [x]; if (guildExperiments[experimentId] != undefined) { console.log(x, guildsWithExps [x]) } } // END CODE */ ``` -------------------------------- ### Example: Discover Discord Internal APIs Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/api-reference-debugging-and-introspection.md Iterates through all added window properties and logs the keys of nested objects, helping to discover Discord's internal APIs and utilities. ```javascript // Discover Discord's internal APIs const added = getAddedWindowValues(); Object.entries(added).forEach(([key, value]) => { if (typeof value === 'object' && Object.keys(value).length > 0) { console.log(`${key}:`, Object.keys(value).slice(0, 5)); } }); ``` -------------------------------- ### Information Modal with Markdown Links Example Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/api-reference-modal-components.md Use this snippet to display an information modal that includes markdown-formatted links in the description. ```javascript // Information modal with markdown const userRead = await createAlertModal( "Important Notice", "Please read the [terms of service](https://example.com/tos) and [privacy policy](https://example.com/privacy)" ); ``` -------------------------------- ### Implement Module Discovery Timeout Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/architecture-and-patterns.md Add a timeout to module discovery loops to prevent excessive execution time for slow searches. This example limits the search to 1 second. ```javascript const search = (name) => { const start = performance.now(); const results = []; for (let [id, mod] of Object.entries(cache())) { if (performance.now() - start > 1000) break; // 1 second timeout if (matches(mod, name)) results.push(mod); } return results; }; ``` -------------------------------- ### Example Structure of Guild Experiments Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/api-reference-guild-channel-operations.md Illustrates the expected nested object structure for the return value of `getAllGuildsExperiments`. Keys are guild identifiers, and values are objects mapping experiment IDs to their configurations. ```javascript { "My Server (123456789)": { "powermode_2022_03_01": {...}, "new_user_onboarding": {...} }, "Another Guild (987654321)": { "powermode_2022_03_01": {...} } } ``` -------------------------------- ### Get All Guild Experiments Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/README.md Discovers active experiments within guilds. ```APIDOC ## getAllGuildsExperiments ### Description Retrieves a list of all active experiments across guilds. ### Method GET ### Endpoint /guilds/experiments ``` -------------------------------- ### Initialize Module Access Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/quick-reference.md Include this snippet in your first script block to get access to module functions. The `getModule` function can then be used anywhere in the console. ```javascript // In your first script block const getModule = ``; // Now you can call getModule() anywhere in console ``` -------------------------------- ### Get User Settings Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/internals/endpoints.md Retrieves the current user's settings. ```APIDOC ## GET /users/@me/settings ### Description Fetches the current user's application settings. ### Method GET ### Endpoint /users/@me/settings ``` -------------------------------- ### Find Guild with Most Experiments Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/api-reference-guild-channel-operations.md An example of how to find and log the guild that has the highest number of experiments by iterating through the results of `getAllGuildsExperiments`. ```javascript // Find the guild with most experiments const allExps = getAllGuildsExperiments(); let maxGuild = null; let maxCount = 0; Object.entries(allExps).forEach(([guildName, experiments]) => { if (Object.keys(experiments).length > maxCount) { maxGuild = guildName; maxCount = Object.keys(experiments).length; } }); console.log(`${maxGuild} has the most with ${maxCount} experiments`); ``` -------------------------------- ### Disable Tracking on Startup Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/api-reference-debugging-and-introspection.md An example of disabling tracking shortly after the Discord client loads. It uses an async IIFE and a delay to ensure Discord is ready before toggling. ```javascript // Disable tracking on startup (async () => { await delay(1000); // Wait for Discord to load toggleTracking(); console.log("Analytics disabled for this session"); })(); ``` -------------------------------- ### Common Added Properties in Discord Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/api-reference-debugging-and-introspection.md An example object illustrating common properties that Discord adds to the global window object, including configuration and library references. ```javascript { webpackChunkdiscord_app: Array, GLOBAL_ENV: { API_ENDPOINT: "https://discord.com/api", API_VERSION: 9, STRIPE_KEY: "...", ANALYTICS_TOKEN: "...", SENTRY_ENABLED: true, // ... more config }, RELEASE_CHANNEL: "stable", // ... and many others } ``` -------------------------------- ### Get User-Level Experiments Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/api-reference-experiments-and-features.md Retrieves user-level experiments registered within the ExperimentStore. This is useful for inspecting experiments specific to the current user. ```javascript // Get user-level experiments const userExperiments = getModule("ExperimentStore").getRegisteredExperiments(); ``` -------------------------------- ### Disable Tracking Example Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/api-reference-debugging-and-introspection.md Demonstrates how to disable tracking and log a confirmation message. This is useful for disabling analytics and error reporting during a session. ```javascript // Disable tracking const trackingWasRe_enabled = toggleTracking(); if (!trackingWasRe_enabled) { console.log("Tracking disabled"); } ``` -------------------------------- ### Check and Toggle Tracking State Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/api-reference-debugging-and-introspection.md Shows how to check the current tracking state and toggle it if necessary. This example assumes a variable `trackingEnabled` is used to track the desired state. ```javascript // Check tracking state and toggle if needed let trackingEnabled = true; toggleTracking(); trackingEnabled = false; ``` -------------------------------- ### Features & Configuration - Tutorial & Onboarding Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/endpoints.md Endpoints for managing tutorial indicators. ```APIDOC ## GET /tutorial/indicators ### Description Get tutorial indicators. ### Method GET ### Endpoint /tutorial/indicators ## POST /tutorial/indicators/suppress ### Description Suppress tutorial indicators. ### Method POST ### Endpoint /tutorial/indicators/suppress ``` -------------------------------- ### Create Tutorial Indicators Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/internals/endpoints.md Creates indicators for user tutorials. ```APIDOC ## POST /tutorial/indicators ### Description Creates tutorial indicators for user guidance. ### Method POST ### Endpoint /tutorial/indicators ``` -------------------------------- ### Get Common Utility Modules Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/quick-reference.md Retrieve modules for various utilities, including permissions, user and channel utilities, message handling, and Snowflake ID manipulation. These provide helpful functions for common tasks. ```javascript getModule("Permissions") // Permission bitset getModule("Users") // User utilities getModule("Channels") // Channel utilities getModule("message") // Message utilities getModule("Snowflake") // ID utilities ``` -------------------------------- ### React Modal Creation and Opening Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/architecture-and-patterns.md Demonstrates the standard pattern for creating a React component tree and opening it as a modal. Ensure React and openModal are available in scope. The returned promise should be resolved by user interaction. ```javascript // 1. Get the React library const React = findReactModule(); // 2. Create component tree using React.createElement() const element = React.createElement(ModalComponent, { header: "Title", children: React.createElement(InputComponent, { ... }) }); // 3. Use openModal to render it openModal(props => { if (props.transitionState === 3) return null; // Closed return element; }); // 4. Return promise for user interaction return new Promise(resolve => { // User interaction triggers resolve }); ``` -------------------------------- ### Toggle User Onboarding Experiment Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/api-reference-experiments-and-features.md Toggles the user onboarding experiment, assigning it to the default treatment bucket. ```javascript // Toggle user onboarding experiment toggleExperiment("user_onboarding"); ``` -------------------------------- ### Get Common UI Component Modules Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/quick-reference.md Access modules for common UI components and libraries like Buttons, Modals, and React. Useful for building custom UI elements within the Discord client. ```javascript getModule("Button") // Button component getModule("Modal") // Modal dialog getModule("TextInput") // Text input field getModule("Markdown") // Markdown renderer getModule("React") // React library getModule("Flex") // Layout component ``` -------------------------------- ### Awaited Asynchronous API Call Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/architecture-and-patterns.md An example of awaiting a Discord API call for creating a friend invite. Use await for operations returning promises, such as network requests. ```javascript async function createFriendInvite() { // ... return await mod.exports.default.createFriendInvite(); } ``` -------------------------------- ### Get Discord Webpack Module by Name Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/api-reference-webpack-utilities.md Retrieves a Discord webpack module by its name or display name. Use `false` for the second argument to get all matching modules instead of just the first. ```javascript function getModule(n, f = true) ``` ```javascript // Get the token module const tokenModule = getModule("getToken"); // Get the current user module const userModule = getModule("getCurrentUser"); // Get markdown renderer const markdownModule = getModule("Markdown"); // Get all button components (as array instead of first match) const allButtonModules = getModule("Button", false); ``` -------------------------------- ### Get Friend Suggestions Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/internals/endpoints.md Retrieves suggestions for friends. ```APIDOC ## GET /friend-suggestions ### Description Fetches a list of suggested friends. ### Method GET ### Endpoint /friend-suggestions ``` -------------------------------- ### Find and Enable New User Experience Experiment Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/api-reference-experiments-and-features.md Finds and enables a new user experience experiment, assigning it to treatment bucket 2. ```javascript // Find and enable a new user experience experiment toggleExperiment("new_user", 2); ``` -------------------------------- ### Get User Mentions Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/internals/endpoints.md Retrieves mentions for the current user. ```APIDOC ## GET /users/@me/mentions ### Description Fetches a list of messages where the current user has been mentioned. ### Method GET ### Endpoint /users/@me/mentions ``` -------------------------------- ### Get Networking Token Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/internals/endpoints.md Retrieves a token for networking-related operations. ```APIDOC ## GET /networking/token ### Description Obtains a token required for specific networking functionalities. ### Method GET ### Endpoint /networking/token ``` -------------------------------- ### Find and Enable Experiment Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/quick-reference.md Prompts the user for an experiment name and an optional bucket number to enable a specific experiment. Defaults to bucket 1 if none is provided. ```javascript const expName = prompt("Experiment name:"); if (expName) { const bucket = prompt("Bucket (default 1):", "1"); toggleExperiment(expName, parseInt(bucket) || 1); } ``` -------------------------------- ### Get User Invites Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/internals/endpoints.md Retrieves invites sent by the current user. ```APIDOC ## GET /users/@me/invites ### Description Fetches a list of invites that the current user has sent. ### Method GET ### Endpoint /users/@me/invites ``` -------------------------------- ### Get User Consent Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/internals/endpoints.md Retrieves consent information for the current user. ```APIDOC ## GET /users/@me/consent ### Description Fetches consent details for the current user. ### Method GET ### Endpoint /users/@me/consent ``` -------------------------------- ### Get Current User Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/internals/endpoints.md Retrieves information about the currently authenticated user. ```APIDOC ## GET /users/@me ### Description Fetches the profile information for the currently logged-in user. ### Method GET ### Endpoint /users/@me ``` -------------------------------- ### Create User Input Prompt Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/quick-reference.md Use `createPromptModal` to display a dialog for user input. It returns the user's input or null if the dialog is canceled. ```javascript const name = await createPromptModal("What's your name?"); if (name !== null) { console.log(`Hello, ${name}!`); } ``` -------------------------------- ### Create and Copy Friend Invite Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/quick-reference.md Generates a new friend invite, extracts the invite code, copies the full invite URL to the clipboard, and logs it to the console. ```javascript (async () => { const invite = await createFriendInvite(); const url = `https://discord.gg/${invite.code}`; navigator.clipboard.writeText(url); console.log(`Copied: ${url}`); })(); ``` -------------------------------- ### Create Guild Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/internals/endpoints.md Creates a new guild. ```APIDOC ## POST /guilds ### Description Creates a new guild. ### Method POST ### Endpoint /guilds ``` -------------------------------- ### Get OAuth2 Token Info Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/internals/endpoints.md Retrieves information about the current OAuth2 token. ```APIDOC ## GET /oauth2/@me ### Description Gets information about the currently authenticated OAuth2 token. ### Method GET ### Endpoint /oauth2/@me ``` -------------------------------- ### Get User Connections Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/internals/endpoints.md Retrieves a list of external connections for the current user. ```APIDOC ## GET /users/@me/connections ### Description Fetches all connected accounts from external services for the current user. ### Method GET ### Endpoint /users/@me/connections ``` -------------------------------- ### Create Channel Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/internals/endpoints.md Creates a new channel. ```APIDOC ## POST /channels ### Description Creates a new channel. ### Method POST ### Endpoint /channels ``` -------------------------------- ### Get Added Window Values Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/README.md Retrieves introspection values from the window environment. ```APIDOC ## getAddedWindowValues ### Description Provides introspection into specific values available in the window environment. ### Method GET ### Endpoint /environment/window-values ``` -------------------------------- ### Accessing Experiment and Developer Stores Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/api-reference-experiments-and-features.md Retrieve instances of ExperimentStore and DeveloperStore to manage experiment state and developer mode flags. Ensure the 'isDeveloper' module is correctly imported or available in the scope. ```javascript // Get experiment store const experimentStore = getModule("ExperimentStore"); const allExperiments = experimentStore.getRegisteredExperiments(); // Get developer store const developerStore = getModule("isDeveloper").constructor; // Check if dev mode enabled const isDev = getModule("isDeveloper"); if (isDev()) { console.log("Dev mode is ON"); } ``` -------------------------------- ### Get OAuth2 Webhook Channels Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/internals/endpoints.md Retrieves channels available for OAuth2 webhook authorization. ```APIDOC ## GET /oauth2/authorize/webhook-channels ### Description Fetches channels that can be used for OAuth2 webhook authorization. ### Method GET ### Endpoint /oauth2/authorize/webhook-channels ``` -------------------------------- ### List Detectable Applications Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/internals/endpoints.md Retrieves a list of applications that can be detected. ```APIDOC ## GET /applications/detectable ### Description Fetches a list of applications that the system can detect. ### Method GET ### Endpoint /applications/detectable ``` -------------------------------- ### Get Join Request Guilds Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/internals/endpoints.md Retrieves guilds for which the user has pending join requests. ```APIDOC ## GET /users/@me/join-request-guilds ### Description Fetches a list of guilds where the user has pending join requests. ### Method GET ### Endpoint /users/@me/join-request-guilds ``` -------------------------------- ### Login Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/internals/endpoints.md Authenticates a user and logs them into the system. ```APIDOC ## POST /auth/login ### Description Logs in a user using their credentials. ### Method POST ### Endpoint /auth/login ``` -------------------------------- ### Get User DMs Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/internals/endpoints.md Retrieves a list of direct message channels for the current user. ```APIDOC ## GET /users/@me/channels ### Description Fetches all direct message channels associated with the authenticated user. ### Method GET ### Endpoint /users/@me/channels ``` -------------------------------- ### Common Debugging Workflow in JavaScript Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/api-reference-debugging-and-introspection.md This snippet demonstrates a typical debugging workflow. It includes steps for checking the environment, enabling developer mode, monitoring network requests, disabling tracking, and manipulating experiments. Ensure the necessary functions like getAddedWindowValues, toggleDevMode, toggleXMLHttpLogging, toggleTracking, and toggleExperiment are available in your scope. ```javascript // 1. Check environment const added = getAddedWindowValues(); console.log("Environment loaded:", !!added.webpackChunkdiscord_app); // 2. Enable debugging toggleDevMode(); // 3. Monitor network toggleXMLHttpLogging(); // 4. Disable tracking toggleTracking(); // 5. Manipulate experiments toggleExperiment("feature_test", 2); // 6. Continue debugging... ``` -------------------------------- ### Moderation & Reporting - Reporting Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/endpoints.md Endpoints for submitting and retrieving reports, and getting report options. ```APIDOC ## POST /report ### Description Submit a report. ### Method POST ### Endpoint /report ## GET /reports ### Description Get a list of reports (admin access required). ### Method GET ### Endpoint /reports ## GET /report/options ### Description Retrieve available options for submitting a report. ### Method GET ### Endpoint /report/options ``` -------------------------------- ### Send MFA SMS Code Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/internals/endpoints.md Sends an SMS code for multi-factor authentication setup or verification. ```APIDOC ## POST /auth/mfa/sms/send ### Description Requests an SMS code to be sent for MFA purposes. ### Method POST ### Endpoint /auth/mfa/sms/send ``` -------------------------------- ### Get PayPal Billing Agreement Tokens Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/internals/endpoints.md Retrieves PayPal billing agreement tokens for the user. ```APIDOC ## GET /users/@me/billing/paypal/billing-agreement-tokens ### Description Fetches tokens required for PayPal billing agreements. ### Method GET ### Endpoint /users/@me/billing/paypal/billing-agreement-tokens ``` -------------------------------- ### Get User Guild Premium Subscriptions Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/internals/endpoints.md Retrieves the current user's guild premium subscriptions. ```APIDOC ## GET /users/@me/guilds/premium/subscriptions ### Description Fetches a list of guild premium subscriptions for the current user. ### Method GET ### Endpoint /users/@me/guilds/premium/subscriptions ``` -------------------------------- ### getAllGuildsExperiments Function Signature Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/api-reference-guild-channel-operations.md This is the basic function signature for retrieving all guild experiments. It takes no parameters. ```javascript function getAllGuildsExperiments() ``` -------------------------------- ### Get External Friend List Entries Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/internals/endpoints.md Retrieves external friend list entries for the current user. ```APIDOC ## GET /users/@me/connections/contacts/@me/external-friend-list-entries ### Description Gets a list of external friend entries associated with the user's connections. ### Method GET ### Endpoint /users/@me/connections/contacts/@me/external-friend-list-entries ``` -------------------------------- ### Get User Activity Statistics Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/internals/endpoints.md Retrieves statistics for applications related to the current user's activities. ```APIDOC ## GET /users/@me/activities/statistics/applications ### Description Gets statistics about applications the user has been active with. ### Method GET ### Endpoint /users/@me/activities/statistics/applications ``` -------------------------------- ### Get All Guild Experiments Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/api-reference-experiments-and-features.md Retrieves all enabled experiments associated with guilds. This function is used for discovery purposes. ```javascript // Get all enabled experiments const allExps = getAllGuildsExperiments(); ``` -------------------------------- ### Create Prompt Modal Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/README.md Creates a modal for text input. ```APIDOC ## createPromptModal ### Description Opens a modal dialog for user text input. ### Method POST ### Endpoint /modals/prompt ### Request Body - **title** (string) - Required - The title of the modal. - **placeholder** (string) - Optional - The placeholder text for the input field. ``` -------------------------------- ### Create Lobby Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/internals/endpoints.md Creates a new lobby for users. ```APIDOC ## POST /lobbies ### Description Creates a new lobby instance. ### Method POST ### Endpoint /lobbies ``` -------------------------------- ### List Integrations Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/internals/endpoints.md Retrieves a list of integrations. ```APIDOC ## GET /integrations ### Description Fetches a list of available integrations. ### Method GET ### Endpoint /integrations ``` -------------------------------- ### getModule(name, firstOnly = true) Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/quick-reference.md Retrieves a module by its name. It can return the first match or all matches. ```APIDOC ## getModule(name, firstOnly = true) ### Description Retrieves a module by its name. It can return the first match or all matches. ### Parameters #### Path Parameters - **name** (string) - Required - Module name to search for - **firstOnly** (boolean) - Optional - true = first match, false = all matches ### Returns - object | array | undefined - Module or array of modules ``` -------------------------------- ### Get User Guild Premium Subscription Slots Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/internals/endpoints.md Retrieves the number of available guild premium subscription slots for the user. ```APIDOC ## GET /users/@me/guilds/premium/subscription-slots ### Description Gets the number of available slots for guild premium subscriptions for the user. ### Method GET ### Endpoint /users/@me/guilds/premium/subscription-slots ``` -------------------------------- ### Register User Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/internals/endpoints.md Registers a new user account. ```APIDOC ## POST /auth/register ### Description Creates a new user account. ### Method POST ### Endpoint /auth/register ``` -------------------------------- ### Get Added Window Values Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/snippets/README.md Retrieves all JavaScript properties that have been added to the window object. This can be useful for inspecting global variables. ```javascript console.log(getAddedWindowValues()); ``` -------------------------------- ### createPromptModal Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/api-reference-modal-components.md Creates a confirmation modal dialog with a text input field and returns the user's input as a promise. ```APIDOC ## createPromptModal ### Description Creates a confirmation modal dialog with a text input field and returns the user's input as a promise. This function allows users to enter a single line of text, with options for a title, default value, and confirmation/cancellation. ### Method `async function` ### Parameters #### Parameters - **title** (string) - Required - The modal header/title text displayed at the top of the dialog. - **defaultValue** (string) - Optional - The initial text to populate in the input field. Defaults to an empty string. ### Return Type `Promise` Returns a promise that resolves to: - `string`: The text value the user entered if they clicked confirm. - `null`: If the user canceled or closed the modal without confirming. ### Usage Examples ```javascript // Prompt user for their name const name = await createPromptModal("What is your name?"); if (name !== null) { console.log(`Hello, ${name}!`); } else { console.log("User canceled"); } // Prompt for input with default value const color = await createPromptModal("Favorite color?", "blue"); console.log(`You like ${color}`); ``` ``` -------------------------------- ### toggleExperiment(name, treatment = 1) Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/quick-reference.md Toggles an experiment by its name and assigns it to a specific treatment bucket. Results are logged to the console. ```APIDOC ## toggleExperiment(name, treatment = 1) ### Description Toggles an experiment by its name and assigns it to a specific treatment bucket. Results are logged to the console. ### Parameters #### Path Parameters - **name** (string) - Required - Experiment ID (substring match) - **treatment** (number) - Optional - Bucket to assign (0 = control, 1+ = treatments) ### Returns - undefined - Logs result to console ``` -------------------------------- ### Async/Await Dialog Prompt Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/README.md Use this pattern to asynchronously prompt the user for input using a modal dialog. The result is then logged to the console. ```javascript const name = await createPromptModal("Your name?"); console.log(`Hello ${name}`); ``` -------------------------------- ### Enable All Debugging Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/quick-reference.md Paste this script into the console to enable all available debugging functionalities and logging. ```javascript // Paste in console to enable full debugging toggleDevMode(); toggleXMLHttpLogging(); toggleTracking(); console.log("Debugging enabled!"); ``` -------------------------------- ### Toggle Network Request Logging Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/quick-reference.md Toggles the logging of XML HTTP requests in the console. Call the function once to start logging, and again to stop. ```javascript toggleXMLHttpLogging(); // Now navigate Discord UI // Watch console for request logs // Toggle again to stop ``` -------------------------------- ### Register User with Phone Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/internals/endpoints.md Registers a new user account using a phone number. ```APIDOC ## POST /auth/register/phone ### Description Registers a new user account and links it to a phone number. ### Method POST ### Endpoint /auth/register/phone ``` -------------------------------- ### List Unverified Applications Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/internals/endpoints.md Retrieves a list of unverified applications. ```APIDOC ## GET /unverified-applications ### Description Fetches a list of applications that are currently unverified. ### Method GET ### Endpoint /unverified-applications ``` -------------------------------- ### Create Alert Modal Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/README.md Creates a modal for user confirmation. ```APIDOC ## createAlertModal ### Description Displays a modal dialog for user confirmation or alerts. ### Method POST ### Endpoint /modals/alert ### Request Body - **message** (string) - Required - The message to display in the alert. ``` -------------------------------- ### Preview Subscriptions Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/internals/endpoints.md Provides a preview of potential subscriptions. ```APIDOC ## GET /users/@me/billing/subscriptions/preview ### Description Shows a preview of available subscription options or changes. ### Method GET ### Endpoint /users/@me/billing/subscriptions/preview ``` -------------------------------- ### Discord Request Payload Structure Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/api-reference-debugging-and-introspection.md Discord's network requests often follow a specific structure for events. This example shows a typical payload format. ```json { events: [ { type: "READY", ... }, { type: "VOICE_STATE_UPDATE", ... } ] } ``` -------------------------------- ### Count Total Experiments Per Guild Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/api-reference-guild-channel-operations.md Demonstrates how to count the number of experiments active in each guild by iterating through the `getAllGuildsExperiments` output and logging the count for each guild. ```javascript // Count total experiments per guild const allExps = getAllGuildsExperiments(); Object.entries(allExps).forEach(([guildName, experiments]) => { console.log(`${guildName}: ${Object.keys(experiments).length} experiments`); }); ``` -------------------------------- ### Get Current Guild Module Utility Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/architecture-and-patterns.md This utility function retrieves the current guild ID by accessing the SelectedGuildStore module. Ensure the SelectedGuildStore module is available. ```javascript function getCurrentGuild() { const guildStore = getModule("SelectedGuildStore"); return guildStore.getGuildId(); } ``` -------------------------------- ### Find Modules Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/quick-reference.md Retrieve specific modules using `getModule` for exact matches or `findModules` for substring searches. Includes basic error handling for when a module is not found. ```javascript // Direct search const userModule = getModule("getCurrentUser"); // Substring search const channelModules = findModules("channel"); // With error handling const mod = getModule("SomeModule"); if (!mod) { console.error("Module not found - try findModules()"); } ``` -------------------------------- ### Generate Friend Invite Link Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/quick-reference.md Generate a friend invite code using `createFriendInvite` and construct a shareable Discord invite link. The link is automatically copied to the clipboard. ```javascript const invite = await createFriendInvite(); const link = `https://discord.gg/${invite.code}`; navigator.clipboard.writeText(link); ``` -------------------------------- ### Create a Prompt Modal Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/api-reference-modal-components.md Creates a confirmation modal with a text input. Returns a promise that resolves with the user's input string or null if canceled. Useful for gathering single-line text input from users. ```javascript async function createPromptModal(title, defaultValue = "") { // Implementation details omitted for brevity // See source for full implementation return new Promise(resolve => { // Mock implementation for demonstration const userInput = prompt(title, defaultValue); resolve(userInput); }); } ``` ```javascript // Prompt user for their name const name = await createPromptModal("What is your name?"); if (name !== null) { console.log(`Hello, ${name}!`); } else { console.log("User canceled"); } ``` ```javascript // Prompt for input with default value const color = await createPromptModal("Favorite color?", "blue"); console.log(`You like ${color}`); ``` ```javascript // Use in a loop for multiple inputs const username = await createPromptModal("Enter username"); const password = await createPromptModal("Enter password"); ``` -------------------------------- ### Future-Proofing Code Patterns Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/architecture-and-patterns.md Demonstrates robust coding patterns to handle potential changes in the Discord client. Includes defensive property access, fallback module searching, and version detection. ```javascript // Defensive against property changes const token = mod?.getToken?.() || mod?.getCurrentToken?.() || null; // Fallback module search const store = getModule("ExperimentStore") || getModule("Experiments"); // Version detection const version = window.GLOBAL_ENV?.API_VERSION || 9; ``` -------------------------------- ### Get Common Data Store Modules Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/quick-reference.md Retrieve modules for accessing data stores like channels, guilds, users, and relationships. These are essential for interacting with Discord's internal data. ```javascript getModule("ChannelStore") // Channels getModule("GuildStore") // Servers getModule("UserStore") // Users getModule("RelationshipStore") // Friends/Blocks getModule("SelectedGuildStore") // Current guild getModule("SelectedChannelStore") // Current channel getModule("ExperimentStore") // A/B tests ``` -------------------------------- ### Toggle Developer Mode Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/README.md Enables or disables developer mode. ```APIDOC ## toggleDevMode ### Description Toggles the developer mode setting. ### Method PUT ### Endpoint /settings/devmode ### Request Body - **enabled** (boolean) - Required - Whether to enable or disable developer mode. ``` -------------------------------- ### View Module Exports Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/quick-reference.md Lists all exports of a given module and provides a detailed view. Useful for inspecting module contents. ```javascript const mod = getModule("MyModule"); console.log(Object.keys(mod)); // List all exports console.dir(mod); // Detailed view ``` -------------------------------- ### Get Added Window Properties Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/api-reference-debugging-and-introspection.md Retrieves all custom JavaScript properties added to the window object by Discord and other scripts. Useful for understanding injected scripts, debugging namespace pollution, and finding new APIs. ```javascript function getAddedWindowValues() ``` -------------------------------- ### Automated Discord Login with Selenium Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/README.md This script automates the Discord web login process using Selenium by injecting a token into the browser's local storage via an iframe. Ensure you have ChromeDriver installed and accessible. ```python # SCRIPT TAKEN FROM "https://github.com/Monst3red/Discord-Token-Login-Tool" import selenium from selenium import webdriver token = input("Token here: ") script = ''' const login = (token) => { setInterval(() => document.body.appendChild(document.createElement `iframe`).contentWindow.localStorage.token = `"${token}"`), 50); setTimeout(() => location.reload(), 2500); }; ''' + f'login("{token}")' # adapted from "https://gist.github.com/m-Phoenix852/b47fffb0fd579bc210420cedbda30b61" driver = webdriver.Chrome("chromedriver.exe") driver.get("https://discord.com/login") driver.execute_script(script) ``` -------------------------------- ### Search and Toggle Experiment by Substring Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/api-reference-experiments-and-features.md Searches for any experiment containing the substring 'thread' and assigns it to treatment bucket 1. ```javascript // Search for any experiment containing "thread" toggleExperiment("thread", 1); ``` -------------------------------- ### Get Webpack Module Cache Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/api-reference-webpack-utilities.md This pattern pushes a temporary entry to Discord's webpack chunk array, extracts the cache object, and then pops the entry to leave no trace. It returns the complete module cache for searching. ```javascript const cache = () => { let webp = window.webpackChunkdiscord_app.push([ [Symbol()], {}, _ => _.c ]); window.webpackChunkdiscord_app.pop(); return webp; }; ``` -------------------------------- ### Discover Module by Direct Named Export Source: https://github.com/doggybootsy/hidden-disc-docs/blob/main/_autodocs/architecture-and-patterns.md Finds a module by searching for its export directly under `module.exports.default[name]` or `module.exports[name]`. This is the fastest discovery strategy and is best for well-known modules. ```javascript // Look for module.exports.default[name] or module.exports[name] Object.values(cache()).find(m => m?.exports?.default?.[name] || m?.exports?.[name] ) ```