Skip to content

Updated endpoint paths after link normalization #7479

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Apr 23, 2025

Conversation

GeniusTimo
Copy link
Contributor

As #7475 did break endpoint paths that contained a link to another resource, I attempted to fix this. As I was working my way trough the git diff of commit a62c908 I noticed some other small things, I attempted to fix as well. Resolves #7478

Removed duplicate/trailing hash in URLs, duplicate parentheses and unnecessary backslashes
The regular expression `[|]{2}FIXME[|]{2}([^|]+)[|]{2}([^|]+)[|]{2}` should be used to replace the placeholders

To get back to the previous state use `{$1$2}` as replacement pattern, but those were broken
Those links got skipped by the check links script
@GeniusTimo
Copy link
Contributor Author

With commit fe1e87a I should have catched all broken endpoint paths. I replaced them with a placeholder, that could safely be replaced using the regular expression [|]{2}FIXME[|]{2}([^|]+)[|]{2}([^|]+)[|]{2} and an appropriate replacement pattern. I was not able to find any documentation regarding the correct format for a link within the endpoint path and therefore provided the following example workflow:

Previous markdown as reference (archived result)

## Get Guild Audit Log % GET /guilds/{guild.id#DOCS_RESOURCES_GUILD/guild-object}/audit-logs

image

Current markdown as reference (current result)

## Get Guild Audit Log % GET /guilds/{guild.id/docs/resources/guild#guild-object}/audit-logs

image

Current placeholder markdown within this pull request

## Get Guild Audit Log % GET /guilds/||FIXME||guild.id||/docs/resources/guild#guild-object||/audit-logs

Applying the replacement pattern

Assuming as an example the links would work like default markdown links, the appropriate replacement pattern would be [{$1}]($2) and can be applied e. g. using Visual Studio Code

image

The resulting markdown of the example line would be

## Get Guild Audit Log % GET /guilds/[{guild.id}](/docs/resources/guild#guild-object)/audit-logs

@GeniusTimo
Copy link
Contributor Author

GeniusTimo commented Apr 20, 2025

In commit 65ed3d2 I took a look at the Help Center links and tried to standardize them by setting the locale to English (US) as not all linked articles are available in all languages. Sometimes if an article is not available in your selected language you get redirected to the login without the possibility to change your language without knowing that you need to add it to the URL or change the language in the Help Center before visiting it. Also the developer documentation is in English, so it's probably more convenient if everything stays in English as it's the original version and the translations are sometimes not the most fluent (at least from my personal experience with the German translations, but I'm also not as fluent in writing English myself as it's always easier with ones native language, so probably not a good argument)

Also I removed the article name from the URL as this can change over time even though it was quite helpful to have the name of the article to search for an appropriate replacement in some cases. In my personal opinion the context in which a link occurs is clear enough most of the time that the article name can be left out and the link can be replaced easier if there are not multiple article names within the URLs.

Some additional notes

The URL https://dis.gd/gwupdate is not retreivable anymore, the redirect still works but it redirects to the login page. I found this archived version of the site, but also this was only used within an old changelog from 2020 and is not relevant anymore. Probably removing the URL would also be a good idea.

All other intents are always enabled by default unless specified otherwise by the identify payload. We have made a support article to explain some of the changes and resulting issues with more details: [Gateway Update FAQ](https://dis.gd/gwupdate)

Kind of the same thing applies to https://support-dev.discord.com/hc/en-us/articles/8561391080471: Archived version available, but only used in a changelog from 2022 and not applicable anymore.

Verified apps or apps that have submitted for verification can temporarily opt-in to a grace period which will allow your app to continue receiving message content until October 1. However, if you opt-in to the grace period, your app will be prevented from joining any additional servers until you opt-out. More details are in the [Help Center article](https://support-dev.discord.com/hc/en-us/articles/8561391080471).

Discord Developer Terms of Service:

  • Within the section 12(e) (Choice of Law; Dispute Resolution) the URL https://discord.com/terms#settling-disputes-between-you-and-discord is not updated to the latest version of the terms of service. The appropriate URL would be https://discord.com/terms#16 as it is used in the important note in paragraph 5.

Discord Developer Policy:

  • At the end of the second paragraph in the Introduction the URL https://support.discord.com/hc/en-us/requests/new could be replaced to https://dis.gd/app-report to prefill some questions within the form

This commit can of course be reverted if these are unwanted changes. I just wanted to continue with the normalization/standardization of URLs within the developer documentation as I was already working my way trough all the URLs within the repository. I also want to point out that I slightly adapted the following two lines (replaced "workarounds" with "alternatives" as the article has been renamed this way too and "DDevs server" with "official Discord Developers Server" as this is how this reference is called in the most cases)

- Help center article on [message content intent alternatives](https://support-dev.discord.com/hc/en-us/articles/6383579033751)
- The official [Discord Developers Server](https://discord.gg/discord-developers) where you can find API updates, ask questions about developing apps, and connect with other developers

@JustinBeckwith
Copy link
Contributor

Please pause working on this one! A lot of the link updates you have are removing things we actually want :) On the issues with the route urls, there is an incoming fix that addresses that problem. I appreciate the callout!

@GeniusTimo
Copy link
Contributor Author

No worries, adjusting the links using the placeholder is zero time effort (creating them was 😌). Looking through the changes in pull request #7485, I noticed a few broken ones. I have just added the new format to compare the results. I'll undo the link changes now, and then it should be limited to what this pull request was originally intended for.

@GeniusTimo
Copy link
Contributor Author

GeniusTimo commented Apr 22, 2025

The following changes are introduced by this pull request now:

  • Fixed broken things from pull request Normalize links #7475 and Use mdx for all route subheadings #7485
    • Endpoint paths that were still broken
    • Wrong link normalization (guild_scheduled_event.id got formatted to guild-scheduled-event.id despite it was not an actual link)
    • Duplicate/trailing hash in URLs (e. g. /docs/interactions/application-commands##get-global-application-commands)
    • Duplicate parentheses (just those I noticed while working my way trough)
    • Unnecessary backslashes (escaping curly braces in inline code shouldn't be necessary)
    • Unnecessary indentation
  • Updated absolute to relative links. Those links were missed by the link check script (e. g. https://discord.com/developers/docs/change-log#feb-14-2022 was an outdated anchor)
  • Changed protocol to https where appropriate (I think 2025 using http has to be a typo in this context 😭)
  • Updated links to the developer TOS and policy as I've seen those used in the TOS and policy referencing each other. I think those are definitely up to date at all time, so this is probably a better idea rather than risking a wrong/outdated link to the TOS and/or policy
  • Updated the invite link to the Discord Developers Server to discord.gg in one case

I've reviewed all changes myself manually once again and think nothing of this should break anything. I am also able to remove things from this list in the code, just let me know or remove it yourself.

@GeniusTimo GeniusTimo marked this pull request as ready for review April 22, 2025 17:31
@GeniusTimo GeniusTimo requested a review from a team as a code owner April 22, 2025 17:31
@GeniusTimo GeniusTimo requested review from JustinBeckwith and removed request for a team April 22, 2025 17:31
@GeniusTimo
Copy link
Contributor Author

I stumbled accross #7490 too during this pull request as it looked inconsistent. Wrapped those in inline code rather than escaping like it's done for other endpoint paths. Left out the method because it would be GET for all of them.

Copy link
Contributor

@JustinBeckwith JustinBeckwith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of small change requests. In the future - it will be a lot easier to land these if they're smaller and single purpose!

Copy link
Contributor

@JustinBeckwith JustinBeckwith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@JustinBeckwith JustinBeckwith merged commit 4c148be into discord:main Apr 23, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Documented endpoints which include something like application.id etc in it are broken
2 participants