Update dependencies (#1929)

This commit is contained in:
Wim
2022-11-27 00:42:16 +01:00
committed by GitHub
parent 6da9d567dc
commit 4fd0a76727
1126 changed files with 1057766 additions and 1385139 deletions

View File

@@ -18,7 +18,7 @@ const (
)
// TextInputElement subtype of DialogInput
// https://api.slack.com/dialogs#option_element_attributes#text_element_attributes
// https://api.slack.com/dialogs#option_element_attributes#text_element_attributes
type TextInputElement struct {
DialogInput
MaxLength int `json:"max_length,omitempty"`

View File

@@ -299,7 +299,7 @@ func (api *Client) UploadFile(params FileUploadParameters) (file *File, err erro
func (api *Client) UploadFileContext(ctx context.Context, params FileUploadParameters) (file *File, err error) {
// Test if user token is valid. This helps because client.Do doesn't like this for some reason. XXX: More
// investigation needed, but for now this will do.
_, err = api.AuthTest()
_, err = api.AuthTestContext(ctx)
if err != nil {
return nil, err
}

View File

@@ -409,6 +409,11 @@ func (t JSONTime) Time() time.Time {
func (t *JSONTime) UnmarshalJSON(buf []byte) error {
s := bytes.Trim(buf, `"`)
if bytes.EqualFold(s, []byte("null")) {
*t = JSONTime(0)
return nil
}
v, err := strconv.Atoi(string(s))
if err != nil {
return err

View File

@@ -51,7 +51,7 @@ func (b *Backoff) Duration() (dur time.Duration) {
return dur
}
//Resets the current value of the counter back to Min
// Resets the current value of the counter back to Min
func (b *Backoff) Reset() {
b.attempts = 0
}

View File

@@ -50,7 +50,7 @@ type SlackErrorResponse struct {
func (r SlackErrorResponse) Error() string { return r.Err }
// RateLimitedError represents the rate limit respond from slack
// RateLimitedError represents the rate limit response from slack
type RateLimitedError struct {
RetryAfter time.Duration
}

View File

@@ -130,17 +130,18 @@ func (api *Client) ListStarsContext(ctx context.Context, params StarsParameters)
// GetStarred returns a list of StarredItem items.
//
// The user then has to iterate over them and figure out what they should
// be looking at according to what is in the Type.
// for _, item := range items {
// switch c.Type {
// case "file_comment":
// log.Println(c.Comment)
// case "file":
// ...
// be looking at according to what is in the Type:
//
// for _, item := range items {
// switch c.Type {
// case "file_comment":
// log.Println(c.Comment)
// case "file":
// ...
// }
//
// }
// This function still exists to maintain backwards compatibility.
// I exposed it as returning []StarredItem, so it shall stay as StarredItem
// I exposed it as returning []StarredItem, so it shall stay as StarredItem.
func (api *Client) GetStarred(params StarsParameters) ([]StarredItem, *Paging, error) {
return api.GetStarredContext(context.Background(), params)
}