forked from lug/matterbridge
Update dependencies (#1951)
This commit is contained in:
18
vendor/github.com/bwmarrin/discordgo/util.go
generated
vendored
18
vendor/github.com/bwmarrin/discordgo/util.go
generated
vendored
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user