|
|
|
@ -2,6 +2,8 @@ package keybase
@@ -2,6 +2,8 @@ package keybase
|
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
|
"encoding/json" |
|
|
|
|
"fmt" |
|
|
|
|
"strings" |
|
|
|
|
"time" |
|
|
|
|
) |
|
|
|
|
|
|
|
|
@ -326,6 +328,19 @@ type mesg struct {
@@ -326,6 +328,19 @@ type mesg struct {
|
|
|
|
|
Body string `json:"body"` |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
type duration struct { |
|
|
|
|
time.Duration |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func (d *duration) UnmarshalJSON(b []byte) (err error) { |
|
|
|
|
d.Duration, err = time.ParseDuration(strings.Trim(string(b), `"`)) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func (d *duration) MarshalJSON() (b []byte, err error) { |
|
|
|
|
return []byte(fmt.Sprintf(`"%s"`, d.String())), nil |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
type options struct { |
|
|
|
|
Channel *Channel `json:"channel,omitempty"` |
|
|
|
|
MessageID int `json:"message_id,omitempty"` |
|
|
|
@ -341,6 +356,7 @@ type options struct {
@@ -341,6 +356,7 @@ type options struct {
|
|
|
|
|
GameID string `json:"game_id,omitempty"` |
|
|
|
|
Alias string `json:"alias,omitempty"` |
|
|
|
|
BotAdvertisements []BotAdvertisement `json:"advertisements,omitempty"` |
|
|
|
|
ExplodingLifetime duration `json:"exploding_lifetime,omitempty"` |
|
|
|
|
|
|
|
|
|
Name string `json:"name,omitempty"` |
|
|
|
|
Public bool `json:"public,omitempty"` |
|
|
|
|