summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/nlopes/slack/info.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2018-08-10 00:38:19 +0200
committerWim <wim@42.be>2018-08-10 00:38:19 +0200
commit68aeb93afa0dd4a5067fcefff9db0a70644d7128 (patch)
treefdd80104c029ba57cb27d54850a3aa7020fedfba /vendor/github.com/nlopes/slack/info.go
parent51062863a5c34d81e296cf15c61140911037cf3b (diff)
downloadmatterbridge-msglm-68aeb93afa0dd4a5067fcefff9db0a70644d7128.tar.gz
matterbridge-msglm-68aeb93afa0dd4a5067fcefff9db0a70644d7128.tar.bz2
matterbridge-msglm-68aeb93afa0dd4a5067fcefff9db0a70644d7128.zip
Update nlopes/slack vendor
Diffstat (limited to 'vendor/github.com/nlopes/slack/info.go')
-rw-r--r--vendor/github.com/nlopes/slack/info.go17
1 files changed, 16 insertions, 1 deletions
diff --git a/vendor/github.com/nlopes/slack/info.go b/vendor/github.com/nlopes/slack/info.go
index 49db5327..db8534c7 100644
--- a/vendor/github.com/nlopes/slack/info.go
+++ b/vendor/github.com/nlopes/slack/info.go
@@ -1,7 +1,9 @@
package slack
import (
+ "bytes"
"fmt"
+ "strconv"
"time"
)
@@ -127,6 +129,19 @@ func (t JSONTime) Time() time.Time {
return time.Unix(int64(t), 0)
}
+// UnmarshalJSON will unmarshal both string and int JSON values
+func (t *JSONTime) UnmarshalJSON(buf []byte) error {
+ s := bytes.Trim(buf, `"`)
+
+ v, err := strconv.Atoi(string(s))
+ if err != nil {
+ return err
+ }
+
+ *t = JSONTime(int64(v))
+ return nil
+}
+
// Team contains details about a team
type Team struct {
ID string `json:"id"`
@@ -156,7 +171,7 @@ type Info struct {
type infoResponseFull struct {
Info
- WebResponse
+ SlackResponse
}
// GetBotByID returns a bot given a bot id