From 61553158764c6801578076c72d8bffb423e343cc Mon Sep 17 00:00:00 2001 From: Jordan Date: Fri, 18 Aug 2023 00:08:21 -0700 Subject: misc: go get -u; go mod tidy; go mod vendor --- vendor/github.com/bwmarrin/discordgo/util.go | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'vendor/github.com/bwmarrin/discordgo/util.go') diff --git a/vendor/github.com/bwmarrin/discordgo/util.go b/vendor/github.com/bwmarrin/discordgo/util.go index 86f43b5..957f301 100644 --- a/vendor/github.com/bwmarrin/discordgo/util.go +++ b/vendor/github.com/bwmarrin/discordgo/util.go @@ -51,7 +51,7 @@ func MultipartBodyWithJSON(data interface{}, files []*File) (requestContentType for i, file := range files { h := make(textproto.MIMEHeader) - h.Set("Content-Disposition", fmt.Sprintf(`form-data; name="file%d"; filename="%s"`, i, quoteEscaper.Replace(file.Name))) + h.Set("Content-Disposition", fmt.Sprintf(`form-data; name="files[%d]"; filename="%s"`, i, quoteEscaper.Replace(file.Name))) contentType := file.ContentType if contentType == "" { contentType = "application/octet-stream" @@ -107,3 +107,19 @@ func bannerURL(bannerHash, staticBannerURL, animatedBannerURL, size string) stri } return URL } + +func iconURL(iconHash, staticIconURL, animatedIconURL, size string) string { + var URL string + if iconHash == "" { + return "" + } else if strings.HasPrefix(iconHash, "a_") { + URL = animatedIconURL + } else { + URL = staticIconURL + } + + if size != "" { + return URL + "?size=" + size + } + return URL +} -- cgit v1.2.3-54-g00ecf