bwmarrin / discordgo

(Golang) Go bindings for Discord
BSD 3-Clause "New" or "Revised" License
5.05k stars 802 forks source link

Expose s.request as s.RequestRaw so one can send JSON directly #1560

Open ldemailly opened 1 month ago

ldemailly commented 1 month ago

Otherwise you need to either artificially make a map[string]any from the json or duplicate

    if bucketID == "" {
        bucketID = strings.SplitN(urlStr, "?", 2)[0]
    }
    return s.RequestWithLockedBucket(method, urlStr, contentType, b, s.Ratelimiter.LockBucket(bucketID), sequence, options...)

and I think the details of the rate limit/locking logic should stay hidden rather than duplicated in caller code