Skip to content

Commit

Permalink
Merge branch 'master' into patch/soundboard
Browse files Browse the repository at this point in the history
  • Loading branch information
sebm253 authored Sep 21, 2024
2 parents 1df7005 + bb89022 commit 76178b1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions discord/cdn_endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,17 @@ func (e CDNEndpoint) URL(format FileFormat, values QueryValues, params ...any) s
query = "?" + query
}

// for some reason custom gif stickers use a different cnd url, blame discord for this one
// for some reason custom gif stickers use a different cdn url, blame discord for this one
if format == FileFormatGIF && e.Route == "/stickers/{sticker.id}" {
return urlPrint(CDNMedia+e.Route+"."+format.String(), params...) + query
}
route := CDN + e.Route
// only append period and file extension if the format is not FileFormatNone
if format != FileFormatNone {
route += "." + format.String()
}

return urlPrint(CDN+e.Route+"."+format.String(), params...) + query
return urlPrint(route, params...) + query
}

func DefaultCDNConfig(format FileFormat) *CDNConfig {
Expand Down

0 comments on commit 76178b1

Please sign in to comment.