Stuff... yay
This commit is contained in:
parent
2f51bf4d58
commit
f73dec458e
1 changed files with 2 additions and 6 deletions
|
@ -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"
|
||||||
|
|
Loading…
Reference in a new issue