2 Commits

Author SHA1 Message Date
6d42a230d1 Fix bugs with direct message api 2021-05-08 15:44:18 -04:00
7166300503 Add more attachment values 2021-05-08 15:44:18 -04:00
2 changed files with 14 additions and 10 deletions

View File

@ -82,6 +82,7 @@ func (c *Client) IndexDirectMessages(ctx context.Context, otherUserID string, re
query.Add("since_id", req.SinceID.String()) query.Add("since_id", req.SinceID.String())
} }
} }
httpReq.URL.RawQuery = query.Encode()
var resp IndexDirectMessagesResponse var resp IndexDirectMessagesResponse
err = c.doWithAuthToken(ctx, httpReq, &resp) err = c.doWithAuthToken(ctx, httpReq, &resp)
@ -127,7 +128,7 @@ func (c *Client) CreateDirectMessage(ctx context.Context, m *Message) (*Message,
} }
var resp struct { var resp struct {
*Message `json:"message"` *Message `json:"direct_message"`
} }
err = c.doWithAuthToken(ctx, httpReq, &resp) err = c.doWithAuthToken(ctx, httpReq, &resp)
if err != nil { if err != nil {

View File

@ -150,11 +150,14 @@ type Attachment struct {
Loci [][]int `json:"loci,omitempty"` Loci [][]int `json:"loci,omitempty"`
UserIDs []ID `json:"user_ids,omitempty"` UserIDs []ID `json:"user_ids,omitempty"`
URL string `json:"url,omitempty"` URL string `json:"url,omitempty"`
FileID string `json:"file_id,omitempty"`
VideoPreviewURL string `json:"preview_url,omitempty"`
Name string `json:"name,omitempty"` Name string `json:"name,omitempty"`
Latitude string `json:"lat,omitempty"` Latitude string `json:"lat,omitempty"`
Longitude string `json:"lng,omitempty"` Longitude string `json:"lng,omitempty"`
Placeholder string `json:"placeholder,omitempty"` Placeholder string `json:"placeholder,omitempty"`
Charmap [][]int `json:"charmap,omitempty"` Charmap [][]int `json:"charmap,omitempty"`
ReplyID ID `json:"reply_id,omitempty"`
} }
func (a *Attachment) String() string { func (a *Attachment) String() string {