Versions in this module Expand all Collapse all v0 v0.2.0 Sep 2, 2018 Changes in this version + const AuthorizationFormat + const BaseURL + const ContentEncoding + const GZIPCompression + const GlobalRateLimiterKey + const HTTPCodeRateLimit + const RateLimitRetryAfter + const UserAgentFormat + const XRateLimitGlobal + const XRateLimitLimit + const XRateLimitRemaining + const XRateLimitReset + func GlobalRateLimit(resp *http.Response) bool + func GlobalRateLimitSafe(resp *http.Response, body *ratelimitBody) bool + func RateLimited(resp *http.Response) bool + func RatelimitChannel(id Snowflake) string + func RatelimitChannelInvites(id Snowflake) string + func RatelimitChannelMessages(id Snowflake) string + func RatelimitChannelMessagesDelete(id Snowflake) string + func RatelimitChannelPermissions(id Snowflake) string + func RatelimitChannelPins(id Snowflake) string + func RatelimitChannelRecipients(id Snowflake) string + func RatelimitChannelTyping(id Snowflake) string + func RatelimitChannelWebhooks(id Snowflake) string + func RatelimitGuild(id Snowflake) string + func RatelimitGuildAuditLogs(id Snowflake) string + func RatelimitGuildBans(id Snowflake) string + func RatelimitGuildChannels(id Snowflake) string + func RatelimitGuildEmbed(id Snowflake) string + func RatelimitGuildIntegrations(id Snowflake) string + func RatelimitGuildInvites(id Snowflake) string + func RatelimitGuildMembers(id Snowflake) string + func RatelimitGuildPrune(id Snowflake) string + func RatelimitGuildRegions(id Snowflake) string + func RatelimitGuildRoles(id Snowflake) string + func RatelimitGuildVanityURL(id Snowflake) string + func RatelimitGuildWebhooks(id Snowflake) string + func RatelimitUsers() string + func RatelimitWebhook(id Snowflake) string + func SupportsDiscordAPIVersion(version int) bool + type Bucket struct + type Client struct + func NewClient(conf *Config) *Client + func (c *Client) Delete(req *Request) (resp *http.Response, body []byte, err error) + func (c *Client) Get(req *Request) (resp *http.Response, body []byte, err error) + func (c *Client) Patch(req *Request) (resp *http.Response, body []byte, err error) + func (c *Client) Post(req *Request) (resp *http.Response, body []byte, err error) + func (c *Client) Put(req *Request) (resp *http.Response, body []byte, err error) + func (c *Client) RateLimiter() RateLimiter + func (c *Client) Request(r *Request) (resp *http.Response, body []byte, err error) + type Config struct + APIVersion int + BotToken string + CancelRequestWhenRateLimited bool + HTTPClient *http.Client + UserAgentExtra string + UserAgentSourceURL string + UserAgentVersion string + type Deleter interface + Delete func(req *Request) (resp *http.Response, body []byte, err error) + type Details struct + Endpoint string + Ratelimiter string + ResponseStruct interface{} + SuccessHttpCode int + type Getter interface + Get func(req *Request) (resp *http.Response, body []byte, err error) + type Patcher interface + Patch func(req *Request) (resp *http.Response, body []byte, err error) + type Poster interface + Post func(req *Request) (resp *http.Response, body []byte, err error) + type Puter interface + Put func(req *Request) (resp *http.Response, body []byte, err error) + type RateLimit struct + func NewRateLimit() *RateLimit + func (r *RateLimit) Bucket(key string) *Bucket + func (r *RateLimit) RateLimitTimeout(key string) int64 + func (r *RateLimit) RateLimited(key string) bool + func (r *RateLimit) UpdateRegisters(key string, resp *http.Response, content []byte) + func (r *RateLimit) WaitTime(req *Request) time.Duration + type RateLimitInfo struct + Empty bool + Global bool + Limit int + Message string + Remaining int + Reset int64 + RetryAfter int64 + func ExtractRateLimitInfo(resp *http.Response, body []byte) (info *RateLimitInfo, err error) + type RateLimiter interface + Bucket func(key string) *Bucket + RateLimitTimeout func(key string) int64 + RateLimited func(key string) bool + UpdateRegisters func(key string, res *http.Response, responseBody []byte) + WaitTime func(req *Request) time.Duration + type Request struct + Endpoint string + JSONParams interface{} + Method string + Ratelimiter string + type Requester interface + Delete func(req *Request) (resp *http.Response, body []byte, err error) + Get func(req *Request) (resp *http.Response, body []byte, err error) + Patch func(req *Request) (resp *http.Response, body []byte, err error) + Post func(req *Request) (resp *http.Response, body []byte, err error) + Put func(req *Request) (resp *http.Response, body []byte, err error) + Request func(req *Request) (resp *http.Response, body []byte, err error)