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

[Bug] Fix GetEventCoverImageUrl by removing the GuildId in the Url string #2577

Merged
merged 1 commit into from
Feb 6, 2023
Merged

[Bug] Fix GetEventCoverImageUrl by removing the GuildId in the Url string #2577

merged 1 commit into from
Feb 6, 2023

Conversation

Twinki14
Copy link
Contributor

@Twinki14 Twinki14 commented Jan 29, 2023

See #2576 for more information

GuildScheduledEvent cover image Urls don't include the related {guildId} in the Url, GuildScheduledEvent cover image Urls are stored on Discord and fetched by only their {eventId} and {assetId}

Invalid Uri: guild-events/1068697076323602503/1069337361063878727/516b0a9fe85c696678d98750589aef5e.png?size=1024
Valid Uri: guild-events/1069337361063878727/516b0a9fe85c696678d98750589aef5e.png?size=1024

Invalid Url: https://cdn.discordapp.com/guild-events/1068697076323602503/1069337361063878727/516b0a9fe85c696678d98750589aef5e.png?size=1024
Valid Url: https://cdn.discordapp.com/guild-events/1069337361063878727/516b0a9fe85c696678d98750589aef5e.png?size=1024

A temporary fix can be achieved by using Replace or any other string manipulation technique

 var coverImageUrl = message.CoverImageId != null ? message.GetCoverImageUrl().Replace($"/{message.Guild.Id}", "") : null;

This closes #2576

@csmir csmir merged commit 0af835a into discord-net:dev Feb 6, 2023
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.

[Bug]: Guild Event Cover Image Urls are not supposed to include the GuildId
2 participants