Skip to content
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

fix: support discordapp.com webhook URLs #8829

Closed
wants to merge 1 commit into from

Conversation

xTVaser
Copy link

@xTVaser xTVaser commented Nov 9, 2022

Please describe the changes this PR makes and why it should be merged:

Webhook URLs copied from Discord are no longer considered valid. They are in the format https://discordapp.com/api/webhooks/{ID}/{TOKEN} now it seems.

This updates the regex to support such URLs and continue to parse it successfully.

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating

@vercel
Copy link

vercel bot commented Nov 9, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Updated
discord-js ⬜️ Ignored (Inspect) Nov 9, 2022 at 5:16PM (UTC)
discord-js-guide ⬜️ Ignored (Inspect) Nov 9, 2022 at 5:16PM (UTC)

@almostSouji
Copy link
Member

What client are you using to copy? I cannot reproduce it on any of mine.
As per spec discordapp.com is only used for the CDN these days.

@Jiralite
Copy link
Member

Jiralite commented Nov 9, 2022

I am not able to reproduce this on all release channels (stable, PTB & canary) additionally.

@ckohen
Copy link
Member

ckohen commented Nov 9, 2022

Webhooks copied from discord use whatever url your client is currently using to access discord. I.e. if you use canary, it will copy canary.discord.com, ptb will copy ptb.canary.com. What this means for you is that your client is also using the unsupported url to make all its requests. On occassion this has been known to happen but it requires your client to be in an incredibly bad state.

TLDR this is a client issue and this regex should intentionally not support discordapp since discord does not.

@almeidx
Copy link
Member

almeidx commented Nov 9, 2022

Duplicate of #7527, #7767

@Jiralite Jiralite closed this Nov 9, 2022
@xTVaser
Copy link
Author

xTVaser commented Nov 9, 2022

TLDR this is a client issue and this regex should intentionally not support discordapp since discord does not.

I see, perhaps a better error message would be useful as this is the format for the URLs I get when copied straight out of the desktop client in multiple channels/servers. I only figured out the problem by digging into the code itself, and would have no idea how or why my client is in an "incredibly bad state" (I'm just using the default discord release, on essentially a fresh OS install).

Sorry for the inconvenience!

@manuelvleeuwen
Copy link
Contributor

I downloaded the Discord client for Linux from the official site and it gives me discordapp.com URLs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants