|
|
|
@ -27,6 +27,19 @@ type Error struct {
@@ -27,6 +27,19 @@ type Error struct {
|
|
|
|
|
Message string `json:"message"` |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
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 SendMessageBody struct { |
|
|
|
|
Body string |
|
|
|
|
} |
|
|
|
@ -41,6 +54,7 @@ type SendMessageOptions struct {
@@ -41,6 +54,7 @@ type SendMessageOptions struct {
|
|
|
|
|
MessageID chat1.MessageID `json:"message_id,omitempty"` |
|
|
|
|
ConfirmLumenSend bool `json:"confirm_lumen_send"` |
|
|
|
|
ReplyTo *chat1.MessageID `json:"reply_to,omitempty"` |
|
|
|
|
ExplodingLifetime duration `json:"exploding_lifetime,omitempty"` |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
type sendMessageParams struct { |
|
|
|
@ -367,19 +381,6 @@ type mesg struct {
@@ -367,19 +381,6 @@ 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 *chat1.ChatChannel `json:"channel,omitempty"` |
|
|
|
|
MessageID int `json:"message_id,omitempty"` |
|
|
|
|