Stuff... yay

This commit is contained in:
jD91mZM2 2017-09-08 17:01:32 +02:00
parent 2f51bf4d58
commit f73dec458e
No known key found for this signature in database
GPG key ID: 3A818BC1F5617A24

View file

@ -87,7 +87,7 @@ func (s *Session) request(method, urlStr, contentType string, b []byte, bucketID
req.Header.Set("Content-Type", contentType) req.Header.Set("Content-Type", contentType)
// TODO: Make a configurable static variable. // TODO: Make a configurable static variable.
req.Header.Set("User-Agent", "DiscordBot (https://github.com/bwmarrin/discordgo, v"+VERSION) req.Header.Set("User-Agent", "DiscordBot (https://github.com/bwmarrin/discordgo, v"+VERSION+")")
if s.Debug { if s.Debug {
for k, v := range req.Header { for k, v := range req.Header {
@ -1382,11 +1382,7 @@ func (s *Session) ChannelMessageSendComplex(channelID string, data *MessageSend)
for i, file := range files { for i, file := range files {
h := make(textproto.MIMEHeader) h := make(textproto.MIMEHeader)
h.Set("Content-Disposition", h.Set("Content-Disposition", fmt.Sprintf(`form-data; name="file%d"; filename="%s"`, i, quoteEscaper.Replace(file.Name),))
fmt.Sprintf(`form-data; name="file%d"; filename="%s"`,
i,
quoteEscaper.Replace(file.Name),
))
contentType := file.ContentType contentType := file.ContentType
if contentType == "" { if contentType == "" {
contentType = "application/octet-stream" contentType = "application/octet-stream"