### Example Application Install Params (Python) Source: https://docs.discord.food/resources/application Demonstrates an application install parameters object, defining the scopes and permissions required for integration. This object is used to configure authorization and access levels for applications. ```json { "scopes": ["applications.commands", "bot"], "permissions": "8" } ``` -------------------------------- ### GET /downloads/distributions/app/installers/latest Source: https://docs.discord.food/topics/client-distribution Redirects to the latest application installer for the selected platform, channel, and architecture. ```APIDOC ## GET /downloads/distributions/app/installers/latest ### Description Redirects to the latest application installer for the selected platform. ### Method GET ### Endpoint `/downloads/distributions/app/installers/latest` ### Parameters #### Query Parameters - **channel** (string) - Required - The release channel to get the installer for (e.g., 'stable', 'ptb', 'canary'). - **platform** (string) - Required - The platform to get the installer for (e.g., 'win32', 'darwin', 'linux'). - **arch** (string) - Required - The architecture to get the installer for (e.g., 'x64', 'arm64'). ### Request Example (No explicit request body, uses query parameters) ### Response (Redirects to the installer file) #### Success Response (302 Found) - (No specific response body, typically a redirect) #### Response Example (HTTP Redirect) ``` -------------------------------- ### Get Latest Distributed Application Installer Source: https://docs.discord.food/topics/client-distribution Redirects to the latest application installer for the selected platform. Requires channel, platform, and architecture as query parameters. ```python import requests def get_latest_distributed_installer(channel, platform, arch): url = "https://discord.com/api/downloads/distributions/app/installers/latest" params = { "channel": channel, "platform": platform, "arch": arch } response = requests.get(url, params=params, allow_redirects=True) return response.url ``` -------------------------------- ### GET /download/{release_channel} Source: https://docs.discord.food/topics/client-distribution Retrieves the latest application installer for a specified release channel and platform. The 'mobile' channel redirects to the mobile client download page. ```APIDOC ## GET /download/{release_channel} ### Description Redirects to the latest application installer for the provided release channel and selected platform. A special release channel of `mobile` may be used to redirect to the download page of the mobile clients. ### Method GET ### Endpoint `/download/{release_channel}` ### Parameters #### Path Parameters - **release_channel** (string) - Required - The release channel for the installer (e.g., 'stable', 'ptb', 'canary', 'mobile'). #### Query Parameters - **platform** (string) - Required - The platform to get the installer for (e.g., 'win32', 'darwin', 'linux'). - **format** (string) - Optional - The executable format to get the installer for (default `deb`). Only applicable to the Linux platform. ### Request Example (No explicit request body, uses path and query parameters) ### Response (Redirects to the installer file or download page) #### Success Response (302 Found) - (No specific response body, typically a redirect) #### Response Example (HTTP Redirect) ``` -------------------------------- ### Application Install Params Object Source: https://docs.discord.food/resources/application Defines parameters for application installation, including authorization scopes and permissions for bot integrations. ```APIDOC ## Application Install Params Object ### Description Specifies the parameters required for installing an application, particularly for bot integrations, including necessary scopes and permissions. ### Fields - **scopes** (array[string]) - The scopes to authorize the integration with. - **permissions** (string) - The permissions to request for the application's bot integration role. ### Example ```json { "scopes": ["applications.commands", "bot"], "permissions": "8" } ``` ``` -------------------------------- ### Get Latest Application Installer Source: https://docs.discord.food/topics/client-distribution Redirects to the latest application installer for a given release channel and platform. Supports a 'mobile' channel for mobile clients. Query parameters include 'platform' and optionally 'format' for Linux. ```python import requests def get_latest_installer(release_channel, platform, format='deb'): url = f"https://discord.com/api/download/{release_channel}" params = { "platform": platform, "format": format } response = requests.get(url, params=params, allow_redirects=True) return response.url ``` -------------------------------- ### Example Guild Profile Source: https://docs.discord.food/resources/discovery A complete example of a guild profile object, demonstrating the structure and data types. ```APIDOC ## Example Guild Profile ```json { "id": "1241115476021481582", "name": "Fehlerjรคger", "icon_hash": "b47f6747d7d6548b6f3eaf8c8e8af20c", "member_count": 131, "online_count": 53, "description": "Do you enjoy finding those creepy crawlies? ๐Ÿ› We seek those with a keen eye and ability for uncovering hidden gems ๐Ÿ”Ž", "brand_color_primary": "#7cf895", "banner_hash": "1468ceeb0f9c384826b982b7eddbfa6f", "game_application_ids": ["356869127241072640"], "game_activity": { "356869127241072640": { "activity_level": 1, "activity_score": 45 } }, "tag": "BUG", "badge": 6, "badge_color_primary": "#32a070", "badge_color_secondary": "#57b59e", "badge_hash": "6082c2553b03b47ccaea5203567df3cf", "traits": [ { "emoji_id": null, "emoji_name": null, "emoji_animated": false, "label": "Bug Hunting", "position": 0 } ], "features": ["MEMBER_VERIFICATION_MANUAL_APPROVAL", "COMMUNITY", "MEMBER_VERIFICATION_GATE_ENABLED"], "visibility": 1, "custom_banner_hash": null, "premium_subscription_count": 13, "premium_tier": 2 } ``` ``` -------------------------------- ### Media Gallery Example JSON Source: https://docs.discord.food/resources/components An example JSON payload for a Media Gallery component, showcasing multiple images with descriptions. ```JSON { "type": 12, "items": [ { "media": { "url": "https://livevideofeedconvertedtoimage/webcam1.png" }, "description": "An aerial view looking down on older industrial complex buildings. The main building is white with many windows and pipes running up the walls." }, { "media": { "url": "https://livevideofeedconvertedtoimage/webcam2.png" }, "description": "An aerial view of old broken buildings. Nature has begun to take root in the rooftops. A portion of the middle building's roof has collapsed inward. In the distant haze you can make out a far away city." }, { "media": { "url": "https://livevideofeedconvertedtoimage/webcam3.png" }, "description": "A street view of a downtown city. Prominently in photo are skyscrapers and a domed building" } ] } ``` -------------------------------- ### Example Gateway Bot Response (JSON) Source: https://docs.discord.food/topics/gateway This is an example JSON response from the GET /gateway/bot endpoint. It shows the WebSocket URL, the recommended number of shards, and details about the session start limit, such as total, remaining, reset time, and maximum concurrency. ```json { "url": "wss://gateway.discord.gg", "shards": 9, "session_start_limit": { "total": 1000, "remaining": 999, "reset_after": 14400000, "max_concurrency": 1 } } ``` -------------------------------- ### Discord Example New Member Welcome Configuration Source: https://docs.discord.food/resources/guild A concrete JSON example of a Discord new member welcome configuration, showcasing a welcome message and a single new member action with a corresponding resource channel. ```json { "guild_id": "1029315212005888060", "enabled": false, "welcome_message": { "author_ids": ["852892297661906993"], "message": "Hello [@username], ๐Ÿ‘ฝ๐Ÿ‘ฝ๐Ÿ‘ฝ" }, "new_member_actions": [ { "channel_id": "1029316811088478299", "action_type": 0, "title": "Get your info", "description": "", "emoji": { "id": null, "name": "๐Ÿ‘ฝ", "animated": false } } ], "resource_channels": [ { "channel_id": "1029316811088478299", "title": "Info", "description": "Absolute cinema" } ] } ``` -------------------------------- ### Example JSON Response - Quest Status Source: https://docs.discord.food/resources/quests An example JSON response illustrating the structure of a quest user status object, including fields for whether the quest started, the status itself, and detailed error hints if applicable. This is often returned by endpoints like 'Start Console Quest'. ```json { "started": false, "quest_user_status": null, "error_hints": ["Xbox account DiscordGamer seems to be offline."], "error_hints_v2": [ { "type": "no_game_offline", "message": "Xbox account DiscordGamer seems to be offline.", "connected_account_id": "3076467402341699", "connected_account_type": "xbox" } ] } ``` -------------------------------- ### Get Subscription Endpoint (Python) Source: https://docs.discord.food/resources/subscription Example of how to retrieve a specific subscription object using its ID with the GET /users/@me/billing/subscriptions/{subscription.id} endpoint. ```python import requests api_token = "YOUR_BOT_TOKEN" base_url = "https://discord.com/api/v9" subscription_id = "SPECIFIC_SUBSCRIPTION_ID" headers = { "Authorization": f"Bot {api_token}", "Content-Type": "application/json" } response = requests.get(f"{base_url}/users/@me/billing/subscriptions/{subscription_id}", headers=headers) if response.status_code == 200: subscription = response.json() print(subscription) else: print(f"Error: {response.status_code} - {response.text}") ``` -------------------------------- ### Example Subscription Plan Source: https://docs.discord.food/resources/store A sample JSON object representing a subscription plan. ```APIDOC ## Example Subscription Plan ```json { "id": "944265636643602432", "name": "None 6 Month", "interval": 1, "interval_count": 6, "tax_inclusive": true, "sku_id": "628379670982688768", "currency": "usd", "price": 0, "price_tier": null, "prices": { "0": { "country_prices": { "country_code": "CA", "prices": [{ "currency": "usd", "amount": 0, "exponent": 2 }] }, "payment_source_prices": {} } } } ``` ``` -------------------------------- ### Discord New Member Welcome Configuration Example Source: https://docs.discord.food/resources/guild An example JSON object representing the configuration for a Discord guild's new member welcome experience. This includes guild ID, enablement status, welcome message details, new member actions, and resource channels. ```json { "guild_id": "960007075288915998", "prompts": [ { "id": "1067461047608422473", "title": "What do you want to do in this community?", "options": [ { "id": "1067461047608422476", "title": "Chat with Friends", "description": "", "emoji": { "id": "1070002302032826408", "name": "chat", "animated": false }, "role_ids": [], "channel_ids": ["962007075288916001"] }, { "id": "1070004843541954678", "title": "Get Gud", "description": "We have excellent teachers!", "emoji": { "id": null, "name": "๐Ÿ˜€", "animated": false }, "role_ids": ["982014491980083211"], "channel_ids": [] } ], "single_select": false, "required": false, "in_onboarding": true, "type": 0 } ], "default_channel_ids": [ "998678771706110023", "998678693058719784", "1070008122577518632", "998678764340912138", "998678704446263309", "998678683592171602", "998678699715067986" ], "enabled": true, "mode": 0, "below_requirements": false } ``` -------------------------------- ### Get Subscriptions Endpoint (Python) Source: https://docs.discord.food/resources/subscription Example of how to retrieve a list of user subscriptions using the GET /users/@me/billing/subscriptions endpoint. This endpoint can be filtered with various query parameters. ```python import requests api_token = "YOUR_BOT_TOKEN" base_url = "https://discord.com/api/v9" headers = { "Authorization": f"Bot {api_token}", "Content-Type": "application/json" } params = { "include_inactive": "true", "limit": "10" } response = requests.get(f"{base_url}/users/@me/billing/subscriptions", headers=headers, params=params) if response.status_code == 200: subscriptions = response.json() print(subscriptions) else: print(f"Error: {response.status_code} - {response.text}") ``` -------------------------------- ### Get Tutorial Source: https://docs.discord.food/resources/user Fetches the current user's tutorial object, providing details on their tutorial progress. Returns a 204 No Content response if no tutorial is available. ```APIDOC ## GET /tutorial ### Description Returns the current user's tutorial object, which contains information about the user's tutorial progress. If no tutorial is available, returns a 204 empty response instead. ### Method GET ### Endpoint /tutorial ### Parameters None ### Request Example None ### Response #### Success Response (200) - **tutorial object** - Information about the user's tutorial progress. #### Response Example ```json { "progress": "completed", "current_step": 5 } ``` #### Success Response (204) No Content ``` -------------------------------- ### Example Role Connection Configuration Source: https://docs.discord.food/resources/guild Provides a Python example illustrating how role connections can be configured, including different connection types and metadata. ```APIDOC ## Example Role Connection Configuration This example demonstrates a potential structure for configuring role connections in Python. It showcases how to specify connection types, metadata fields, operators, and values. ### Configuration Structure ```python [ [ { "connection_type": "paypal", "connection_metadata_field": null, "operator": null, "value": null }, { "connection_type": "paypal", "connection_metadata_field": "verified", "operator": 1, # INTEGER_LESS_THAN_OR_EQUAL "value": "1" }, { "connection_type": "paypal", "connection_metadata_field": "created_at", "operator": 4, # INTEGER_NOT_EQUAL "value": "0" } ], [ { "connection_type": "spotify", "connection_metadata_field": null, "operator": null, "value": null } ] ] ``` ``` -------------------------------- ### Get Guild Integration Application IDs Example (Python) Source: https://docs.discord.food/resources/integration Retrieves a mapping of guild IDs to application IDs associated with their integrations for the current user's guilds. An example JSON response is provided. ```json { "81384788765712384": [ "157858575924985856", "157889000391180288", "157873248346832897", "157947794294833152", "173805066229252096" ], "1046920999469330512": [] } ``` -------------------------------- ### Example Application Executable (Python) Source: https://docs.discord.food/resources/application Provides an example of an application executable object, specifying the operating system, executable name, and whether it's a game launcher. This helps in identifying and managing application binaries. ```json { "os": "win32", "name": "spaceship looter/spaceship_looter.exe", "is_launcher": false } ``` -------------------------------- ### Discord Welcome Screen Configuration Example Source: https://docs.discord.food/resources/guild This JSON object defines the structure for a Discord server's welcome screen. It includes a server description and a list of welcome channels, each with its own description and optional emoji. This is used to onboard new members into a community. ```json { "description": "Discord Developers is a place to learn about Discord's API, bots, and SDKs and integrations. This is NOT a general Discord support server.", "welcome_channels": [ { "channel_id": "697138785317814292", "description": "Follow for official Discord API updates", "emoji_id": null, "emoji_name": "๐Ÿ“ก" }, { "channel_id": "697236247739105340", "description": "Get help with Bot Verifications", "emoji_id": null, "emoji_name": "๐Ÿ“ธ" }, { "channel_id": "697489244649816084", "description": "Create amazing things with Discord's API", "emoji_id": null, "emoji_name": "๐Ÿ”ฌ" }, { "channel_id": "613425918748131338", "description": "Integrate Discord into your game", "emoji_id": null, "emoji_name": "๐ŸŽฎ" }, { "channel_id": "646517734150242346", "description": "Find more places to help you on your quest", "emoji_id": null, "emoji_name": "๐Ÿ”ฆ" } ] } ``` -------------------------------- ### Experiment Population Range Object and Example (Python) Source: https://docs.discord.food/topics/experiments Describes the structure of an experiment population range, which specifies a bucket and its rollout strategy. The example shows a typical representation in Python, including start and end times for the rollout. ```Python [ 1, [ { "s": 0, "e": 4750 } ] ] ``` -------------------------------- ### Example Quest Configuration in Python Source: https://docs.discord.food/resources/quests Demonstrates a comprehensive quest configuration object in Python. It includes details about the quest's ID, timing, features, application, assets, colors, messages, task configurations, and rewards. ```python { "id": "8206816794116096000", "config": { "id": "8206816794116096000", "config_version": 2, "starts_at": "2025-02-21T18:00:00+00:00", "expires_at": "2025-02-28T01:00:00+00:00", "features": [3, 9, 12, 14, 15, 16], "experiments": { "rollout": "2025-02_alien", "targeting": null, "preview": "2025-02_alien_preview" }, "application": { "link": "https://alien.studios/cyberalien", "id": "891436233903964161", "name": "Cyberalien 2077" }, "assets": { "hero": "hero.jpg", "hero_video": "hero.mp4", "quest_bar_hero": "questbar.jpg", "quest_bar_hero_video": "questbar.mp4", "game_tile": "gametile.jpg", "logotype": "wordmark.png" }, "colors": { "primary": "#E944D4", "secondary": "#5318A7" }, "messages": { "quest_name": "Kill the Aliens", "game_title": "Cyberalien 2077", "game_publisher": "Alien Studios" }, "task_config": { "type": 1, "join_operator": "or", "tasks": { "PLAY_ON_DESKTOP": { "event_name": "PLAY_ON_DESKTOP", "target": 900, "external_ids": [] }, "PLAY_ON_XBOX": { "event_name": "PLAY_ON_XBOX", "target": 900, "external_ids": ["267696969"] }, "PLAY_ON_PLAYSTATION": { "event_name": "PLAY_ON_PLAYSTATION", "target": 900, "external_ids": ["CUSA42069_00"] } } }, "rewards_config": { "assignment_method": 1, "rewards": [ { "type": 1, "sku_id": "1342624440894361624", "asset": "CYBERNETIC_HEADGEAR_HELL_YEAHHH.png", "asset_video": null, "messages": { "name": "Cybernetic Headgear", "name_with_article": "a Cybernetic Headgear", "redemption_instructions_by_platform": { "0": "Reward Instructions:\nGo to https://alien.studios/redeem\nEnter your code\nClaim your reward!" } }, "approximate_count": null, "redemption_link": "https://alien.studios/redeem" } ], "rewards_expire_at": "2025-03-28T00:00:00+00:00", "platforms": [0] } }, "user_status": null, "targeted_content": [], "preview": false } ``` -------------------------------- ### Get Channel Linked Accounts Example Response (JSON) Source: https://docs.discord.food/resources/channel An example of the JSON response body when retrieving linked accounts for users in a group DM. It maps user IDs to a list of their linked accounts, each with an ID and name. ```json { "linked_accounts": { "150745989836308480": [ { "id": "3067653496106923", "name": "Cynosphere" }, { "id": "OGE2N2M2MDE4ZWY4YTM1YzI4Y2RkNmU0MDkyZGNiOWE3Y2I0YjhlZTZhNDNkYThkZjQyZjNhZjRhNGRkOGE3YQ", "name": "Cynosphere" } ], "1001086404203389018": [ { "id": "3076033886540956", "name": "Dziurwel14" } ] } } ``` -------------------------------- ### Python Example Role Connection Configuration Source: https://docs.discord.food/resources/guild An example of how to structure role connection configurations in Python, demonstrating different connection types, metadata fields, operators, and values. This includes configurations for PayPal and Spotify. ```python [ [ { "connection_type": "paypal", "connection_metadata_field": null, "operator": null, "value": null }, { "connection_type": "paypal", "connection_metadata_field": "verified", "operator": 1, "value": "1" }, { "connection_type": "paypal", "connection_metadata_field": "created_at", "operator": 4, "value": "0" } ], [ { "connection_type": "spotify", "connection_metadata_field": null, "operator": null, "value": null } ] ] ``` -------------------------------- ### Discord Partial Guild Object Example Source: https://docs.discord.food/resources/guild An example of a partial Discord Guild object, typically returned from the Get User Guilds endpoint. This object contains essential information about a guild a user is a member of, including its name, description, and enabled features. ```json { "id": "752630786561409076", "name": "Elite Creative", "icon": "278da1c7740e394657c1179f4782aef1", "description": "The largest Fortnite Creative server across the globe. Join a Creative community offering events, 1v1s. and more!", "home_header": null, "splash": "2b4ae5cdd71038b4880b1b57a6e5dacb", "discovery_splash": "9d7ec672b89b320ef7a51e5b6ae453b8", "features": [ "ANIMATED_BANNER", "ANIMATED_ICON", "AUTO_MODERATION", "BANNER", "COMMUNITY", "DISCOVERABLE", "ENABLED_DISCOVERABLE_BEFORE", "GUILD_ONBOARDING_EVER_ENABLED", "GUILD_WEB_PAGE_VANITY_URL", "INVITE_SPLASH", "NEWS", "PREVIEW_ENABLED", "RAID_ALERTS_ENABLED", "ROLE_ICONS", "VANITY_URL", "WELCOME_SCREEN_ENABLED" ], "approximate_member_count": 155451, "approximate_presence_count": 7532, "emojis": [], "stickers": [] } ``` -------------------------------- ### Voice Filters Catalog Example Response (JSON) Source: https://docs.discord.food/resources/voice This is an example JSON response for the 'Get Voice Filters Catalog' endpoint. It includes limited time voices, ONNX models with their CDN URLs, and a list of available voice filters with their properties. ```JSON { "limited_time_voices": { "current_set": ["solara", "robot"], "current_set_start": "2025-05-22T00:00:00+00:00", "current_set_end": "2025-05-22T23:59:59+00:00", "next_set": ["tunes", "robot"], "next_set_start": "2025-05-23T00:00:00+00:00", "next_set_end": "2025-05-23T23:59:59+00:00" }, "models": { "vocoder_large_1": { "url": "https://cdn.discordapp.com/assets/content/XXX.onnx" }, "asr_large": { "url": "https://cdn.discordapp.com/assets/content/XXX.onnx" }, "pitch_small_3": { "url": "https://cdn.discordapp.com/assets/content/XXX.onnx" } }, "voices": [ { "id": "skye", "models": ["vocoder_large_1", "asr_large", "pitch_small_3"], "requires_premium": true, "limited_time_free_ends": "2025-05-22T23:59:59+00:00", "limited_time_free_starts": "2025-05-22T00:00:00+00:00", "available": true } ] } ``` -------------------------------- ### Create Application Quick Link Source: https://docs.discord.food/resources/application Creates a new activity quick link. Returns an activity link object on success. ```APIDOC ## POST /applications/{application.id}/quick-links/ ### Description Creates a new activity quick link. Returns an activity link object on success. ### Method POST ### Endpoint /applications/{application.id}/quick-links/ #### Path Parameters - **application.id** (string) - Required - The ID of the application #### Request Body - **custom_id** (?string) - Optional - A custom id for the activity link (1-256 characters) - **description** (string) - Required - The description of the activity link (1-64 characters) - **image** (image data) - Required - The activity link asset - **title** (string) - Required - The title of the activity link (1-32 characters) ``` -------------------------------- ### Top Emoji Structure and Example Response (Discord API) Source: https://docs.discord.food/resources/emoji Defines the structure for top emoji objects returned by the 'Get Guild Top Emojis' endpoint, including `emoji_id` and `emoji_rank`. An example response shows a list of these objects, ordered by rank. ```json { "items": [ { "emoji_id": "1145727546747535412", "emoji_rank": 1 }, { "emoji_id": "1174435954090594505", "emoji_rank": 2 }, { "emoji_id": "1029462631163117629", "emoji_rank": 3 }, { "emoji_id": "1030570693903011921", "emoji_rank": 4 }, { "emoji_id": "1077714345825407067", "emoji_rank": 5 } ] } ``` -------------------------------- ### Example Detectable Application Configuration Source: https://docs.discord.food/resources/application This JSON object represents a detectable application, likely for game integration. It includes aliases, executable paths for different operating systems, and metadata like ID, name, and themes. ```json { "aliases": ["PUBG: BATTLEGROUNDS", "PUBG"], "executables": [ { "is_launcher": false, "name": "win64/tslgame_be.exe", "os": "win32" }, { "is_launcher": false, "name": "win64/tslgame.exe", "os": "win32" }, { "is_launcher": false, "name": "tslgame.exe", "os": "win32" }, { "is_launcher": false, "name": "win64/tslgame_uc.exe", "os": "win32" }, { "is_launcher": false, "name": "tslgame_be.exe", "os": "win32" } ], "hook": true, "id": "356873622985506820", "name": "PLAYERUNKNOWN'S BATTLEGROUNDS", "overlay": true, "overlay_compatibility_hook": true, "overlay_methods": null, "overlay_warn": false, "themes": ["Action", "Warfare"] } ``` -------------------------------- ### Get Latest Android Minimum Version Source: https://docs.discord.food/topics/client-distribution Retrieves the minimum required version for Android clients. If the installed version is below this, the client will prompt the user to update. ```APIDOC ## GET /apps/android/versions.json ### Description Retrieves the minimum required version for Android clients. If the installed version is below this, the client will prompt the user to update. ### Method GET ### Endpoint /apps/android/versions.json ### Parameters #### Query Parameters None ### Request Example None ### Response #### Success Response (200) - **discord_android_min_version** (string) - The minimum required version string for the Android client. #### Response Example ```json { "discord_android_min_version": "158000" } ``` ``` -------------------------------- ### Example Application SKU (Python) Source: https://docs.discord.food/resources/application Illustrates an application SKU object, which includes the game's ID, SKU, and distributor. This is crucial for uniquely identifying games and their distribution platforms. ```json { "id": "445220", "sku": "445220", "distributor": "steam" } ``` -------------------------------- ### Experiment Structures and Examples Source: https://docs.discord.food/topics/experiments Details on the structure and examples of various experiment-related objects, including population range filters, overrides, and apex experiments. ```APIDOC ## Experiment Population Range By Hash Filter Structure This filter is used to limit rollout position by an additional hash key. The calculated rollout position must be less than the given target. The rollout position can be calculated using the following pseudocode, where `hash_key` is the provided hash key and `resource_id` is the guild ID: ```python import mmh3 hashed = mmh3.hash('hash_key:resource_id', signed=False) if hashed > 0: # Double the hash hashed += hashed else: # Unsigned right shift by 0 hashed = (hashed % 0x100000000) >> 0 result = hashed % 10000 ``` ### Parameters - **hash_key** (integer) - The 32-bit unsigned Murmur3 hash of the key used to determine eligibility - **target** (integer) - The rollout position limit for this population ### Example Experiment Population Filters ```json [ [ 1604612045, // guild_has_feature [ [ 1183251248, // guild_features ["ROLE_SUBSCRIPTIONS_ENABLED"] ] ] ] ] ``` ## Experiment Bucket Override Object An override represents a manual setting by Discord employees to grant a guild early or specific access to an experiment. ### Experiment Bucket Override Structure - **b** (integer) - Bucket assigned to these resources - **k** (array[snowflake]) - Resources granted access to this bucket ### Experiment Bucket Override Example ```json { "b": 1, "k": ["882680660588904448", "882703776794959873", "859533785225494528", "859533828754505741"] } ``` ## Apex Experiments Object ### Apex Experiments Structure - **assignments** (map[integer, map[snowflake, apex experiment assignments object]]) - A mapping of unit type to mapping of unit IDs to their assignments ### Apex Experiment Assignments Structure - **evaluation_id** (?string) - The ID of the evaluation - **assignments** (array[apex experiment object]) - The assignments for the apex experiment unit ### Apex Experiment Unit Type - **1** (USER) - Experiment is for a user ### Example Apex Experiments ```json { "assignments": { "1": { "852892297661906993": { "evaluation_id": "cd659a5d", "assignments": [ [3759954850, 1, 0, 2], [4240376458, 0, 0, 8], [956087042, 1, 0, 2], [1605213660, 0, 2, 0], [3164674236, 1, 0, 4], [3436651650, 1, 1, 0], [1581149260, 0, 0, 3], [13763179, 1, 2, 0], [721000765, 1, 2, 0], [2657741306, 0, 2, 3], [341733491, 0, 2, 3], [76075180, 0, 2, 3], [2722069991, 0, 2, 3], [196982166, 1, 0, 0], [1228731397, 1, 2, 0], [1132732657, 1, 2, 0] ] } } } } ``` ## Apex Experiment Object ### Apex Experiment Object Fields - **hashed_name** (integer) - 32-bit unsigned Murmur3 hash of the experiment's name - **variant_id** (integer) - The ID of the assigned experiment variant for target - **flags** (?integer) - The experiment's flags - **revision** (integer) - Current version of the rollout ### Apex Experiment Flags - **1 << 0** (IS_OVERRIDE) - Experiment is an override ### Apex Experiment Surface - **1** (API) - Return apex experiments that alter API functionality - **2** (APP) - Return apex experiments that alter client functionality - **3** (DEVELOPER_PORTAL) - Return apex experiments that alter developer portal functionality - **4** (ADMIN_PANEL) - Return apex experiments that alter admin panel functionality ``` -------------------------------- ### Get Gateway Bot Endpoint Information (Discord API) Source: https://docs.discord.food/topics/gateway This section describes the GET /gateway/bot endpoint of the Discord API. It returns gateway information along with metadata for large or sharded bots. The response includes the WebSocket URL, recommended shards, and session start limit details. This route should not be cached. ```http GET /gateway/bot ``` -------------------------------- ### Discord API: Get Thread Post Data Example Source: https://docs.discord.food/resources/channel An example JSON response body for retrieving post data for threads. It maps thread IDs to their respective post data, including first message and owner information. This structure is typically returned by endpoints designed to fetch thread details. ```json { "threads": { "1075957063890509894": { "first_message": null, "owner": null } } } ``` -------------------------------- ### POST /websites/discord_food Source: https://docs.discord.food/resources/team Initiates the Stripe Connect onboarding process for a website, returning a redirect URL for the user to complete the setup. ```APIDOC ## POST /websites/discord_food ### Description Initiates the Stripe Connect onboarding process for a website, returning a redirect URL for the user to complete the setup. ### Method POST ### Endpoint /websites/discord_food ### Request Body This endpoint does not explicitly define a request body in the provided documentation. ### Request Example ```json { "example": "request body" } ``` ### Response #### Success Response (200) - **stripe_connect_redirect_url** (string) - The Stripe Connect redirect URL #### Response Example ```json { "stripe_connect_redirect_url": "https://connect.stripe.com/setup/e/acct_123456/789abcd" } ``` ``` -------------------------------- ### GET /gateway/bot Source: https://docs.discord.food/topics/gateway Retrieves gateway information, including the WebSocket URL, recommended shards, and session start limits. This endpoint is useful for large or sharded bots and should not be cached extensively. ```APIDOC ## GET /gateway/bot ### Description Returns an object based on the information in Get Gateway, plus additional metadata that can help during the operation of large or sharded bots. Unlike Get Gateway, this route should not be cached for extended periods of time as the value is not guaranteed to be the same per-call, and changes as the user joins/leaves guilds. ### Method GET ### Endpoint /gateway/bot ### Parameters #### Query Parameters None #### Path Parameters None ### Request Example None ### Response #### Success Response (200) - **url** (string) - The WebSocket URL that can be used for connecting to the Gateway - **shards** (integer) - The recommended number of shards to use when connecting - **session_start_limit** (session start limit object) - Information on the current session start limit #### Response Example ```json { "url": "wss://gateway.discord.gg", "shards": 9, "session_start_limit": { "total": 1000, "remaining": 999, "reset_after": 14400000, "max_concurrency": 1 } } ``` ### Notes *Unauthenticated*: Does not require authentication ``` -------------------------------- ### Application Install Parameters Source: https://docs.discord.food/resources/application Retrieves the default in-app authorization link for the integration, custom authorization link, and configuration for various integration types. ```APIDOC ## GET /websites/discord_food/install_params ### Description This endpoint provides details about the installation parameters for an application, including default authorization links and integration type configurations. ### Method GET ### Endpoint /websites/discord_food/install_params ### Parameters #### Query Parameters - **application_install_params** (object) - Optional - The default in-app authorization link for the integration. - **custom_install_url** (string) - Optional - The default custom authorization link for the integration. - **integration_types_config** (map[integer, object]) - Optional - The configuration for each integration type supported by the application. ### Response #### Success Response (200) - **connection_entrypoint_url** (string) - The URL which users will be directed to when connecting their account in the application to their Discord account. - **is_verified** (boolean) - Whether the application is verified. - **verification_state** (integer) - The current verification state of the application. - **store_application_state** (integer) - The current store approval state of the commerce application. - **rpc_application_state** (integer) - The current RPC approval state of the application. - **creator_monetization_state** (integer) - The current guild creator monetization state of the application. - **is_discoverable** (boolean) - Whether the application is discoverable in the application directory. - **discoverability_state** (integer) - The current application directory discoverability state of the application. - **discovery_eligibility_flags** (integer) - The current application directory eligibility flags for the application. - **is_monetized** (boolean) - Whether the application has monetization enabled. - **storefront_available** (boolean) - Whether the application has public subscriptions or products available for purchase. - **monetization_state** (integer) - The current application monetization state of the application. - **monetization_eligibility_flags** (integer) - The current application monetization eligibility flags for the application. - **max_participants** (integer) - The maximum possible participants in the application's embedded activity (-1 for no limit). - **embedded_activity_config** (object) - The configuration for the application's embedded activity. - **approved_consoles** (array[integer]) - The approved console types for social SDK builds. - **pricing_localization_strategy** (string) - The pricing localization strategy used for the application's store presence. #### Response Example ```json { "connection_entrypoint_url": "https://example.com/connect", "is_verified": true, "verification_state": 1, "store_application_state": 0, "rpc_application_state": 0, "creator_monetization_state": 0, "is_discoverable": true, "discoverability_state": 1, "discovery_eligibility_flags": 0, "is_monetized": false, "storefront_available": false, "monetization_state": 0, "monetization_eligibility_flags": 0, "max_participants": -1, "embedded_activity_config": {}, "approved_consoles": [1, 2], "pricing_localization_strategy": "EACH" } ``` ``` -------------------------------- ### Create Application Quick Link (Python) Source: https://docs.discord.food/resources/application Creates a new activity quick link for an application. Requires application ID, link description, title, and an image asset. An optional custom ID can be provided. Returns the created link object on success. ```python import requests app_id = "your_application_id" url = f"https://discord.com/api/v10/applications/{app_id}/quick-links/" headers = { "Authorization": "Bot YOUR_BOT_TOKEN" } files = { "image": open("path/to/your/quick_link_image.png", "rb") } data = { "title": "Quick Access", "description": "Fast link to important info.", "custom_id": "quick_link_1" } response = requests.post(url, headers=headers, data=data, files=files) if response.status_code == 200: print("Quick link created:", response.json()) else: print(f"Error creating quick link: {response.status_code}", response.text) ``` -------------------------------- ### Get User Application Command Index Source: https://docs.discord.food/interactions/application-commands Returns an application command index object for the current user, containing the commands available from all applications installed to the user's account. ```APIDOC ## GET /users/@me/application-command-index ### Description Returns an application command index object for the current user, containing the commands available from all applications installed to the user's account. ### Method GET ### Endpoint `/users/@me/application-command-index` ### Response #### Success Response (200) - **(object)** - Application command index object. ``` -------------------------------- ### POST /applications Source: https://docs.discord.food/resources/application Creates a new application. Returns an application object on success. ```APIDOC ## POST /applications ### Description Creates a new application. Returns an application object on success. Users can have a maximum of 50 applications, with each team able to have a maximum of 25. ### Method POST ### Endpoint /applications ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body (The request body schema is not provided in the input text, but typically includes fields to define the new application, such as name, description, etc.) ### Request Example (Request body example not provided in the input text.) ### Response #### Success Response (200) - **application** (object) - The newly created application object. #### Response Example (Response body example not provided in the input text.) ``` -------------------------------- ### Get Unauthenticated Report Menu Source: https://docs.discord.food/topics/reports Retrieves a report menu object for a specified type. This menu guides users through the reporting process with hierarchical nodes. ```APIDOC ## GET /reporting/unauthenticated/menu/{type} ### Description Returns a report menu object for the specified type. The menu contains a hierarchical tree of nodes that guide users through the reporting process, including questions, options, and submission steps. ### Method GET ### Endpoint `/reporting/unauthenticated/menu/{type}` ### Parameters #### Path Parameters - **type** (string) - Required - The type of the report menu to retrieve. #### Query Parameters - **variant?** (string) - Optional - The version variant of the menu to retrieve (max 256 characters, default latest). ### Response #### Success Response (200) - **token** (string) - The email verification token #### Response Example ```json { "token": "string" } ``` ```