-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat(Widget): support fetching widget image #8589
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
fetchImage(style) { | ||
const styles = ['banner1', 'banner2', 'banner3', 'banner4', 'shield']; | ||
if (!styles.includes(style)) style = 'shield'; | ||
const data = `https://discord.com/api/v${APIVersion}${Routes.guildWidgetImage(this.id)}?style=${style}`; |
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.
This could be returned directly.
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.
This is not resolved
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.
Still not resolved (original comment: #8589 (comment)) - Also, is there no function for this link in discord-api-types somewhere?
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.
Besides the previous review, this could use RouteBases.api
+ Routes.guildWidgetImage(this.id)
from discord-api-types (need to handle the query string separately)
Co-authored-by: Suneet Tipirneni <77477100+suneettipirneni@users.noreply.github.com>
Are you still maintaining this @dager-mohamed? Seems like there are merge conflicts and unresolved conversations |
idk why there are merge conflicts, but there are no resolved conversations |
fetchImage(style) { | ||
const styles = ['banner1', 'banner2', 'banner3', 'banner4', 'shield']; | ||
if (!styles.includes(style)) style = 'shield'; | ||
const data = `https://discord.com/api/v${APIVersion}${Routes.guildWidgetImage(this.id)}?style=${style}`; |
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.
This is not resolved
GuildWidgetStyle needs to be added to the APITypes file |
Co-authored-by: Almeida <almeidx@pm.me>
@dager-mohamed is attempting to deploy a commit to the discordjs Team on Vercel. A member of the Team first needs to authorize it. |
Co-authored-by: Almeida <almeidx@pm.me>
Co-authored-by: Almeida <almeidx@pm.me>
Co-authored-by: Almeida <almeidx@pm.me>
all things are done |
@@ -83,6 +83,16 @@ class Widget extends Base { | |||
this._patch(data); | |||
return this; | |||
} | |||
|
|||
/** | |||
* Get Guild Widget Image |
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.
This is not a great description
fetchImage(style) { | ||
const styles = ['banner1', 'banner2', 'banner3', 'banner4', 'shield']; | ||
if (!styles.includes(style)) style = 'shield'; | ||
const data = `https://discord.com/api/v${APIVersion}${Routes.guildWidgetImage(this.id)}?style=${style}`; |
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.
Still not resolved (original comment: #8589 (comment)) - Also, is there no function for this link in discord-api-types somewhere?
Co-authored-by: Almeida <almeidx@pm.me>
Co-authored-by: Almeida <almeidx@pm.me>
Co-authored-by: Almeida <almeidx@pm.me>
now done |
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.
There are still conversations that are marked as resolved but are not resolved.
* @param {GuildWidgetStyle} [style=GuildWidgetStyle.Shield] The style for the widget image | ||
* @returns {string} | ||
*/ | ||
imageURL(style = GuildWidgetStyle.Shield) { |
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.
Why are we defaulting to this? I don't think we should have a default value for this.
done |
No, not done. Re-review the conversations. |
bro where? |
https://github.com/discordjs/discord.js/pull/8589/files#r991311523 You were told it is not a great description (which it is not). You resolved it without making any changes, leaving it to be still a lacklustre description. https://github.com/discordjs/discord.js/pull/8589/files#r991539399 This ideally shouldn't have a default. I don't see a reason why discord.js should default it. https://github.com/discordjs/discord.js/pull/8589/files#r962216556 You've been told this one hasn't been resolved multiple times, despite marking it as resolved. No changes have been made here. |
Co-authored-by: Almeida <almeidx@pm.me>
fetchImage(style) { | ||
const styles = ['banner1', 'banner2', 'banner3', 'banner4', 'shield']; | ||
if (!styles.includes(style)) style = 'shield'; | ||
const data = `https://discord.com/api/v${APIVersion}${Routes.guildWidgetImage(this.id)}?style=${style}`; |
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.
Besides the previous review, this could use RouteBases.api
+ Routes.guildWidgetImage(this.id)
from discord-api-types (need to handle the query string separately)
Superseded by #9782. |
Please describe the changes this PR makes and why it should be merged:
Status and versioning classification: