Versions in this module Expand all Collapse all v0 v0.26.11 Jun 7, 2021 Changes in this version + const AuthorizationFormat + const BaseURL + const ContentEncoding + const ContentType + const ContentTypeJSON + const DisgordNormalizedHeader + const GZIPCompression + const GlobalHash + const MethodDelete + const MethodGet + const MethodPatch + const MethodPost + const MethodPut + const RateLimitRetryAfter + const RegexpEmoji + const RegexpReactionPrefix + const RegexpSnowflakes + const RegexpURLSnowflakes + const UserAgentFormat + const XAuditLogReason + const XDisgordNow + const XRateLimitBucket + const XRateLimitGlobal + const XRateLimitLimit + const XRateLimitPrecision + const XRateLimitRemaining + const XRateLimitReset + const XRateLimitResetAfter + var ErrRateLimited error = &Error + func HeaderToTime(header http.Header) (t time.Time, err error) + func NormalizeDiscordHeader(statusCode int, header http.Header, body []byte) (h http.Header, err error) + func SupportsDiscordAPIVersion(version int) bool + type Client struct + func NewClient(conf *Config) (*Client, error) + func (c *Client) BucketGrouping() (group map[string][]string) + func (c *Client) Do(ctx context.Context, r *Request) (resp *http.Response, body []byte, err error) + type Config struct + APIVersion int + BotToken string + CancelRequestWhenRateLimited bool + HttpClient HttpClientDoer + RESTBucketManager RESTBucketManager + UserAgentExtra string + UserAgentSourceURL string + UserAgentVersion string + type Details struct + Endpoint string + Ratelimiter string + ResponseStruct interface{} + SuccessHTTPCode int + type ErrREST struct + Bucket []string + Code int + HTTPCode int + HashedEndpoint string + Msg string + Suggestion string + func (e *ErrREST) Error() string + type Error struct + func (e *Error) Error() string + type HttpClientDoer interface + Do func(req *http.Request) (*http.Response, error) + type Manager struct + func NewManager(defaultRelations map[string]string) *Manager + func (r *Manager) Bucket(id string, cb func(bucket RESTBucket)) + func (r *Manager) BucketGrouping() (group map[string][]string) + func (r *Manager) Consolidate() + func (r *Manager) ProxyID(id string) (pID string) + func (r *Manager) UpdateProxyID(id, pID, bucketHash string) + type RESTBucket interface + Transaction func(context.Context, func() (*http.Response, []byte, error)) (*http.Response, []byte, error) + type RESTBucketManager interface + Bucket func(localHash string, cb func(bucket RESTBucket)) + BucketGrouping func() (group map[string][]string) + type RateLimitResponseStructure struct + Global bool + Message string + RetryAfter float64 + type Request struct + Body interface{} + ContentType string + Ctx context.Context + Endpoint string + Method httpMethod + Reason string + func (r *Request) HashEndpoint() string + func (r *Request) PopulateMissing() + type Requester interface + Do func(ctx context.Context, req *Request) (resp *http.Response, body []byte, err error) + type Snowflake = snowflake.Snowflake