Add post format selection

This commit is contained in:
r 2019-12-26 11:25:29 +00:00
parent ac4ff88adb
commit 591360f2a8
11 changed files with 66 additions and 15 deletions

View file

@ -273,6 +273,7 @@ type Toot struct {
Sensitive bool `json:"sensitive"`
SpoilerText string `json:"spoiler_text"`
Visibility string `json:"visibility"`
ContentType string `json:"content_type"`
}
// Mention hold information for mention.

View file

@ -266,6 +266,9 @@ func (c *Client) PostStatus(ctx context.Context, toot *Toot) (*Status, error) {
if toot.SpoilerText != "" {
params.Set("spoiler_text", toot.SpoilerText)
}
if toot.ContentType != "" {
params.Set("content_type", toot.ContentType)
}
var status Status
err := c.doAPI(ctx, http.MethodPost, "/api/v1/statuses", params, &status, nil)