Skip to content

Commit 7206885

Browse files
Use static directory for images (#7472)
1 parent b74dcc7 commit 7206885

File tree

274 files changed

+190
-189
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

274 files changed

+190
-189
lines changed

CONTRIBUTING.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ For example:
4545
> Something that requires warning here
4646
```
4747

48-
![Alert options](images/alerts.png)
48+
![Alert options](static/images/alerts.png)
4949

5050
### MDX Components
5151

@@ -56,6 +56,7 @@ There are a few reusable MDX components that can be used on pages with the `mdx`
5656
Collapsibles allow you to show/hide content on a page that may be secondary to the page's primary content. They have four fields that can be set: `title`, `description`, `icon`, and an `open` flag (which makes the collapsible element open by default).
5757

5858
Available options for `icon`:
59+
5960
- `"list"`
6061
- `"view"`
6162
- `"question"`
@@ -64,7 +65,7 @@ Available options for `icon`:
6465

6566
###### Example
6667

67-
![Collapsible MDX Component with the list icon](images/mdx-collapsible.png)
68+
![Collapsible MDX Component with the list icon](static/images/mdx-collapsible.png)
6869

6970
```markdown
7071
<Collapsible title="Title" description="Description text" icon="list">
@@ -78,7 +79,7 @@ Buttons are simply... clickable buttons. They take `href` and `color` as argumen
7879

7980
###### Example
8081

81-
![Button MDX Component](images/mdx-button.png)
82+
![Button MDX Component](static/images/mdx-button.png)
8283

8384
```markdown
8485
<LinkButton to="https://discord.com/developers/docs/getting-started" color="brand">click the button!</LinkButton>
@@ -90,7 +91,7 @@ Cards let you display links in a card format. They accept two arguments, `title`
9091

9192
###### Example
9293

93-
![Card MDX Component](images/mdx-card.png)
94+
![Card MDX Component](static/images/mdx-card.png)
9495

9596
```markdown
9697
<Card title="Card Title" link="https://discord.com/developers/docs/getting-started">

docs/activities/building-an-activity.mdx

+9-9
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ It assumes an understanding of [JavaScript](https://developer.mozilla.org/en-US/
1616

1717
<Collapsible title="What we'll be building" icon="view">
1818

19-
![Building Your First Activity Tutorial](activities/tutorial-hero.png)
19+
![Building Your First Activity Tutorial](images/activities/tutorial-hero.png)
2020

2121
</Collapsible>
2222

@@ -142,7 +142,7 @@ You can learn more about the OAuth flow and redirect URIs in the [OAuth2 documen
142142

143143
Click on **OAuth2** on the sidebar in your app's settings. Under **Redirects**, enter `https://127.0.0.1` as a placeholder value then click **Save Changes**.
144144

145-
![Redirect URI in Activity Settings](activities/oauth2-redirect.png)
145+
![Redirect URI in Activity Settings](images/activities/oauth2-redirect.png)
146146

147147
### Fetch Your OAuth2 Credentials
148148

@@ -297,7 +297,7 @@ Because Activities are in a sandbox enviornment and go through the Discord proxy
297297
298298
Back in your app's settings, click on the **URL Mappings** page under **Activities** on the left-hand sidebar. Enter the URL you generated from `cloudflared` in the previous step.
299299
300-
![Configuring your URL Mapping](activities/url-mapping-tutorial.png)
300+
![Configuring your URL Mapping](images/activities/url-mapping-tutorial.png)
301301
302302
| PREFIX | TARGET |
303303
|--------|-----------------------------------------|
@@ -311,7 +311,7 @@ Next, we'll need to enable Activities for your app. On the left hand sidebar und
311311
312312
Find the first checkbox, labeled `Enable Activities`. Turn it on 🎉
313313
314-
![Enabling Activities in Settings](activities/enable-activities.png)
314+
![Enabling Activities in Settings](images/activities/enable-activities.png)
315315
316316
#### Default Entry Point Command
317317
@@ -328,7 +328,7 @@ Navigate to your Discord test server and, in any voice and or text channel, open
328328
329329
Clicking on your app will launch your locally running app from inside Discord!
330330
331-
![Running your activity](activities/start-activity.png)
331+
![Running your activity](images/activities/start-activity.png)
332332
333333
> info
334334
> **Customizing your Activity** <br/> If you'd like to set images for your Activity, you can learn how to do that [here](#DOCS_ACTIVITIES_DEVELOPMENT_GUIDES/setting-up-activity-metadata).
@@ -356,7 +356,7 @@ We will use `express` for this example, but any backend language or framework wi
356356
357357
This diagram illustrates the common pattern for granting a user an OAuth2 access_token:
358358
359-
![Flow diagram for Oauth2](activities/oauth-flow-diagram.svg)
359+
![Flow diagram for Oauth2](images/activities/oauth-flow-diagram.svg)
360360
361361
We will be implementing this pattern in this tutorial, but more example implementations can also be found in this sample project:
362362
@@ -529,7 +529,7 @@ document.querySelector('#app').innerHTML = `
529529
530530
Now if we relaunch our app, we'll be prompted to authorize with Discord using the `identify`, `guilds`, and `applications.commands` scopes.
531531
532-
![Prompt to authorize Activity](activities/tutorial-auth.png)
532+
![Prompt to authorize Activity](images/activities/tutorial-auth.png)
533533
534534
> warn
535535
> **Safe storage of tokens**<br />
@@ -592,7 +592,7 @@ setupDiscordSdk().then(() => {
592592
593593
If you close and rejoin the Activity, you should now see the name of the current channel.
594594
595-
![Discord Activities](activities/tutorial-channel-name.png)
595+
![Discord Activities](images/activities/tutorial-channel-name.png)
596596
597597
<Collapsible title="Step 6 Checkpoint" icon="list" open>
598598
@@ -665,7 +665,7 @@ setupDiscordSdk().then(() => {
665665
666666
If we relaunch our Activity, we will see the current server's avatar render in our Activity.
667667
668-
![Discord Activities](activities/tutorial-hero.png)
668+
![Discord Activities](images/activities/tutorial-hero.png)
669669
670670
<Collapsible title="Step 7 Checkpoint" icon="list" open>
671671

docs/activities/design-patterns.mdx

+4-4
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ When in an Activity with others, make the actions and presence of the others vis
4949
- If a user has customized their server nickname or avatar, use their server nickname or avatar in game.
5050
- Show when a user is speaking in the voice call, or whether they're active or inactive.
5151

52-
![Speech bubbles in Bobble League](activities/bobble-bash.png)
52+
![Speech bubbles in Bobble League](images/activities/bobble-bash.png)
5353

5454

5555
### Respect user privacy
@@ -67,7 +67,7 @@ Make your app fast, easy to join, and maximize fun to launch a crowd favorite.
6767
- Surprise and delight is about caring about the small details of how a person experiences your work.
6868
- Put the right emotion in when they least expect it to deliver the magic.
6969

70-
![Bobble League](activities/bobble-league.png)
70+
![Bobble League](images/activities/bobble-league.png)
7171

7272
### Keep load times as low as possible
7373
- This allows for easier drop-in drop-out behavior for the large portion of mobile users on Discord.
@@ -80,7 +80,7 @@ Make your app fast, easy to join, and maximize fun to launch a crowd favorite.
8080
- Activities are frictionless to join and easy to discover, so you can expect that users will join mid-experience. Give those users something to do, even if it's just letting them spectate until they can join without being disruptive. In the same vein, users can leave without notice or become afk (away from keyboard). Handle these cases gracefully.
8181
- Create a case for users who have joined a call but have not yet started playing or engaging. Allow these users to "spectate" other users who are playing. This can also be helpful for Activities that have an ideal number in mind for play.
8282

83-
![Support drop-in, drop-out behavior in your Activity](activities/eights.png)
83+
![Support drop-in, drop-out behavior in your Activity](images/activities/eights.png)
8484

8585
### Make your app as available as possible
8686

@@ -105,7 +105,7 @@ Discord is a social platform where users talk to each other. Sharing and invites
105105
- Share photos or GIFs that capture moments of fun and memorable, or something to brag about. Don't make things shareable just to feature the activity.
106106
- Sharing a high score alone may not be very engaging, but sharing a really good move made in a game, or a collaborative drawing that creates a memory is a conversation starter and may make others want to join in on the fun.
107107

108-
![Shared Moment from Chess in the Park](activities/chess-victory.png)
108+
![Shared Moment from Chess in the Park](images/activities/chess-victory.png)
109109

110110
#### Activities in Text Channels
111111
- The Activity user interface, copy and user flows should not rely on people in voice to explain, organize, clarify, or instruct about how the activity works.

docs/activities/development-guides.mdx

+17-17
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ https://funky-jogging-bunny.trycloudflare.com
172172

173173
In the Discord Developer Portal, update the Application URL mapping for `/` url to `funky-jogging-bunny.trycloudflare.com` to match your network tunnel address and save your changes.
174174

175-
![Configuring your URL Mapping](activities/url-mapping-tutorial.png)
175+
![Configuring your URL Mapping](images/activities/url-mapping-tutorial.png)
176176

177177
> warn
178178
> If you do not own the URL that you are using to host the application (i.e. ngrok's free tier), someone else could claim that domain and host a malicious site in its place. Please be aware of these risks, and if you have to use a domain you do not own, be sure to reset your URL mapping when you are done using the tunnel.
@@ -189,7 +189,7 @@ The flow for setting up your production application is very similar:
189189
4. Follow the instructions for [Launching your Application from the Discord Client](#DOCS_ACTIVITIES_DEVELOPMENT_GUIDES/launch-your-application-from-the-discord-client)). Application URL Override should not be enabled.
190190

191191
This application now uses the same configuration it will use once it is fully published ✨.
192-
![application-test-mode-prod](activities/application-test-mode-prod.gif)
192+
![application-test-mode-prod](images/activities/application-test-mode-prod.gif)
193193

194194

195195
---
@@ -226,7 +226,7 @@ Because your application is "sandboxed", it will be unable to make network reque
226226

227227
To add or modify your application's URL mappings, click on `Activities -> URL Mappings` and set the prefix and target values for each mapping as needed.
228228

229-
![Configuring your URL Mapping](activities/url-mapping-tutorial.png)
229+
![Configuring your URL Mapping](images/activities/url-mapping-tutorial.png)
230230

231231
#### Prefix/Target formatting rules
232232

@@ -238,10 +238,10 @@ To add or modify your application's URL mappings, click on `Activities -> URL Ma
238238
- Targets must point to a directory; setting a target to a file (e.g. `example.com/index.html`) is unsupported and may lead to unexpected behavior.
239239
- Because of how URL globbing works, if you have multiple prefix urls with the same initial path, you must place the shortest of the prefix paths last in order for each url mapping to be reachable. For example, if you have `/foo` and `/foo/bar`, you must place the url `/foo/bar` before `/foo` or else the mapping for `/foo/bar` will never be reached.
240240

241-
| ✅ DO | ❌ DON'T |
242-
|------------------------------------------------------|------------------------------------------------------------|
243-
| Requests mapped correctly | Requests to /foo/bar will incorrectly be sent to `foo.com` |
244-
| ![url-mapping-do.png](activities/url-mapping-do.png) | ![url-mapping-dont.png](activities/url-mapping-dont.png) |
241+
| ✅ DO | ❌ DON'T |
242+
|-------------------------------------------------------------|-----------------------------------------------------------------|
243+
| Requests mapped correctly | Requests to /foo/bar will incorrectly be sent to `foo.com` |
244+
| ![url-mapping-do.png](images/activities/url-mapping-do.png) | ![url-mapping-dont.png](images/activities/url-mapping-dont.png) |
245245

246246
#### Exceptions
247247

@@ -291,7 +291,7 @@ The first section of Debug Logs are not your application logs but Discord specif
291291

292292
When you scroll down the page, your application logs should be visible.
293293

294-
![debug-logs-filtering](activities/debug-logs-filtering.gif)
294+
![debug-logs-filtering](images/activities/debug-logs-filtering.gif)
295295

296296
#### Sharing Application Logs from Mobile
297297

@@ -346,7 +346,7 @@ discordSdk.commands.openExternalLink({
346346

347347
#### User Experience
348348

349-
![external-link-modal](activities/external-link-modal.png)
349+
![external-link-modal](images/activities/external-link-modal.png)
350350

351351
Users will see a modal inside the Discord app notifying them whether or not they want to proceed. By clicking **_Trust this Domain_**, users will not see a modal for that specific domain again.
352352

@@ -381,7 +381,7 @@ try {
381381

382382
User Experience
383383

384-
![Invite Dialog UI](activities/invite-dialog.png)
384+
![Invite Dialog UI](images/activities/invite-dialog.png)
385385

386386
Users will see a modal inside the Discord app allowing them to send an invite to a channel, friend, or copy an invite link to share manually.
387387

@@ -434,7 +434,7 @@ await discordSdk.commands.openShareMomentDialog({mediaUrl});
434434

435435
User Experience
436436

437-
![share-moment-dialog](activities/share-moment-dialog-example.png)
437+
![share-moment-dialog](images/activities/share-moment-dialog-example.png)
438438

439439
---
440440

@@ -502,7 +502,7 @@ console.log(`Hardware Acceleration is ${enabled === true ? 'enabled' : 'disabled
502502

503503
#### User Experience
504504

505-
![encourage-hardware-acceleration-modal](activities/encourage-hardware-acceleration-modal.png)
505+
![encourage-hardware-acceleration-modal](images/activities/encourage-hardware-acceleration-modal.png)
506506

507507

508508
---
@@ -516,7 +516,7 @@ By default, your Activity will be launchable on web/desktop. To enable or disabl
516516
- Select `Activities` -> `Settings` in the left-side of the developer portal, or visit `https://discord.com/developers/<your app id>/embedded/settings`
517517
- From check the appropriate checkboxes in the developer portal, and save your changes
518518

519-
![supported-platforms](activities/supported-platforms.png)
519+
![supported-platforms](images/activities/supported-platforms.png)
520520

521521
---
522522

@@ -621,7 +621,7 @@ discordSdk.commands.setOrientationLockState({
621621

622622
It's also possible to configure an application with a default orientation lock state via the Developer Portal. Using this method, the Discord app will apply the orientation lock when launching the application before the SDK has been initialized. This can create a smoother application launch flow where the application starts in the correct orientation rather than switching to the correct orientation after some delay after the application requests an orientation lock via the SDK. The Developer Portal supports setting a different default orientation lock states for phones versus tablets.
623623

624-
![default-orientation-lock-state](activities/default_orientation_lock_state.png)
624+
![default-orientation-lock-state](images/activities/default_orientation_lock_state.png)
625625

626626
#### Subscribing to Screen Orientation Updates
627627

@@ -772,7 +772,7 @@ Rest assured: other activities will not be able to make requests with your activ
772772

773773
When a user clicks "Join Application", they expect to enter the same application that their friends are participating in. Whether the application is a shared drawing canvas, board game, collaborative playlist, or first-person shooter; the two users should have access to the same shared data. In this documentation, we refer to this shared data as an **application instance**.
774774

775-
![join-application](activities/join-application.png)
775+
![join-application](images/activities/join-application.png)
776776

777777
The Embedded App SDK allows your app to talk bidirectionally with the Discord Client. The `instanceId` is necessary for your application, as well as Discord, to understand which unique instance of an application it is talking to.
778778

@@ -1027,7 +1027,7 @@ Once you're satisfied with your changes you can click on the copy icon on the ro
10271027
10281028
#### User Experience
10291029
1030-
![custom-link-embed](activities/custom-link-embed.png)
1030+
![custom-link-embed](images/activities/custom-link-embed.png)
10311031
10321032
Users will see an embed with your information displayed. Clicking "Play" opens the activity and passes through the `custom_id` you've set. A `referrer_id` will be present for links shared on Discord.
10331033

@@ -1091,7 +1091,7 @@ curl https://discord.com/api/applications/1215413995645968394/activity-instances
10911091
With this API, the activity's backend can verify that a client is in fact in an instance of that activity before allowing the client to participate in any meaningful gameplay. How an activity implements "session verification" is left to the developer's discretion. The solution can be as granular as gating specific features or as binary as not returning the activity HTML except for valid sessions.
10921092

10931093
In the below flow diagram, we show how the server can deliver the activity website, only for valid users in a valid activity instance:
1094-
![application-test-mode-prod](activities/activity-instance-validation.jpg)
1094+
![application-test-mode-prod](images/activities/activity-instance-validation.jpg)
10951095

10961096
---
10971097

docs/activities/how-activities-work.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@ async function setup() {
6060

6161
This diagram illustrates the communication flow between your application and Discord in the sample code above.
6262

63-
![Diagram of how Activities communicate with Discord](activities/embedded-app-flow-diagram.svg)
63+
![Diagram of how Activities communicate with Discord](images/activities/embedded-app-flow-diagram.svg)

docs/activities/overview.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebar_label: Overview
44

55
# Overview of Activities
66

7-
![Building Discord Activities](activities/activities-hero.png)
7+
![Building Discord Activities](images/activities/activities-hero.png)
88

99
**Activities** are multiplayer games and social experiences that can be launched in Discord. Activities can integrate with Discord features like user identity, voice and chat, profile data like Rich Presence, and native monetization.
1010

docs/change-log/2022-11-17-upcoming-application-command-permission-changes.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ If a command-level configuration does not exist for the given context, the syste
7070

7171
Below is a simplified flowchart that illustrates how permissions will be applied by the Discord client after the new changes take effect.
7272

73-
![Flowchart with an overview of the new permissions configurations logic](new-permissions-flowchart.svg)
73+
![Flowchart with an overview of the new permissions configurations logic](images/new-permissions-flowchart.svg)
7474

7575
#### 2. `APPLICATION_COMMAND_PERMISSIONS_V2` Guild Feature
7676

docs/developer-tools/game-sdk.mdx

+4-4
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,11 @@ You're ready to go! Check out the rest of the documentation for more info on how
232232
In your project folder, you'll want to make something like a "discord-files" folder, for organization. In that folder, copy all the `.h` and `.cpp` files from the zip.
233233
You want to include all the header and source files respectively in your project
234234
235-
![Correct Files](cpp-files-sdk.png)
235+
![Correct Files](images/cpp-files-sdk.png)
236236
237237
In your project settings, you'll want to include the relevant library (e.g. `discord_game_sdk.dll.lib`) as an additional dependency.
238238
239-
![Linked Library](lib-linked-sdk.png)
239+
![Linked Library](images/lib-linked-sdk.png)
240240
241241
- From there, you should be able to `#include "discord-files/discord.h"`, or whatever the path to that header file is, and have access to the code.
242242
</Collapsible>
@@ -1274,7 +1274,7 @@ Opens the overlay widget for voice settings for the currently connected applicat
12741274

12751275
<Collapsible title="Screenshot of the Voice Settings modal for an application" icon="view">
12761276

1277-
![Screenshot of the Voice Settings modal for an application](game-overlay-sdk-voice-settings.png)
1277+
![Screenshot of the Voice Settings modal for an application](images/game-overlay-sdk-voice-settings.png)
12781278
</Collapsible>
12791279

12801280
Returns a `Discord.Result` via callback.
@@ -1333,7 +1333,7 @@ overlayManager.OpenActivityInvite(ActivityActionType.Join, (result) =>
13331333

13341334
And that invite modal looks like this!
13351335

1336-
![Screenshot of an Invitation Modal in an application](game-overlay-sdk-invite.gif)
1336+
![Screenshot of an Invitation Modal in an application](images/game-overlay-sdk-invite.gif)
13371337

13381338
</Collapsible>
13391339

0 commit comments

Comments
 (0)