-
-
Notifications
You must be signed in to change notification settings - Fork 131
feat(REST): add CDNRoutes
#502
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
It should, as the PR you linked adds it as a route, not a cdn route |
ImRodry
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you wanna add a size parameter in every endpoint?
|
Outside of defining them as interfaces, just like how we do for other rest endpoints, no. So, if @vvito7 wants to do that then they can, otherwise this is fineee |
|
Should we maybe export & use types like |
I could of course, but would it be something like this? I got a little confused export interface RESTGetCDNRouteQuery {
/**
* The returned image can have the size changed by using this query parameter
*/
size?: AllowedImageSizes;
}
export type AllowedImageSizes = 16 | 32 | 56 | 64 | 96 | 128 | 256 | 300 | 512 | 600 | 1024 | 2048 | 4096;
I like the idea 👍 |
Yes, but maybe we should just type size as a number? Also this can use a diff interface name (CDNQuery?) if you want |
Yes, sure. But there is a bunch of numbers that don't work
Sure👍 |
Well its just powers of 2 so... that should be easy enough |
|
Except it isn’t |
|
Source? |
|
Discord.js, discord docs, whatever floats your boat |
|
Well call me nuts because Discord says it themselves: https://discord.com/developers/docs/reference#image-formatting-image-base-url
|
|
Tried to implement what @didinele said, but I don't think it's what they wanted. Also there is so many duplicated stuff |
|
That's basically it, just make each one a
that's alright. |
Please describe the changes this PR makes and why it should be merged:
Adds the constant
CDNRoutes, that contains each CDN entpoint from DDevs Portal. Made it because of #453 (comment). With this, many other things are being added:ImageFormats,CDNQueryand*Formattypes.If applicable, please reference Discord API Docs PRs or commits that influenced this PR: