From dc87541c928b18af07df570c209439fd7f62a933 Mon Sep 17 00:00:00 2001 From: trwnh Date: Fri, 3 Jul 2020 06:35:55 -0500 Subject: [PATCH] AnnouncementReactions and examples (#789) --- content/en/entities/announcement.md | 69 +++++++++++++++++++-- content/en/entities/announcementReaction.md | 62 ++++++++++++++++++ content/en/methods/announcements.md | 65 ++++++++++++++++++- 3 files changed, 188 insertions(+), 8 deletions(-) create mode 100644 content/en/entities/announcementReaction.md diff --git a/content/en/entities/announcement.md b/content/en/entities/announcement.md index b1c3e0fb..9a1e0147 100644 --- a/content/en/entities/announcement.md +++ b/content/en/entities/announcement.md @@ -8,6 +8,48 @@ menu: ## Example ```javascript +{ + "id": "8", + "content": "

Looks like there was an issue processing audio attachments without embedded art since yesterday due to an experimental new feature. That issue has now been fixed, so you may see older posts with audio from other servers pop up in your feeds now as they are being finally properly processed. Sorry!

", + "starts_at": null, + "ends_at": null, + "all_day": false, + "published_at": "2020-07-03T01:27:38.726Z", + "updated_at": "2020-07-03T01:27:38.752Z", + "read": true, + "mentions": [], + "statuses": [], + "tags": [], + "emojis": [], + "reactions": [ + { + "name": "bongoCat", + "count": 9, + "me": false, + "url": "https://files.mastodon.social/custom_emojis/images/000/067/715/original/fdba57dff7576d53.png", + "static_url": "https://files.mastodon.social/custom_emojis/images/000/067/715/static/fdba57dff7576d53.png" + }, + { + "name": "thonking", + "count": 1, + "me": false, + "url": "https://files.mastodon.social/custom_emojis/images/000/098/690/original/a8d36edc4a7032e8.png", + "static_url": "https://files.mastodon.social/custom_emojis/images/000/098/690/static/a8d36edc4a7032e8.png" + }, + { + "name": "AAAAAA", + "count": 1, + "me": false, + "url": "https://files.mastodon.social/custom_emojis/images/000/071/387/original/AAAAAA.png", + "static_url": "https://files.mastodon.social/custom_emojis/images/000/071/387/static/AAAAAA.png" + }, + { + "name": "🤔", + "count": 1, + "me": true + } + ] +} ``` ## Base attributes @@ -33,44 +75,59 @@ menu: **Version history:**\ 3.1.0 - added -### `all_day` +### `all_day` {#all_day} **Description:** Whether the announcement has a start/end time.\ **Type:** Boolean\ **Version history:**\ 3.1.0 - added -### `created_at` +### `created_at` {#created_at} **Description:** When the announcement was created.\ **Type:** String \(ISO 8601 Datetime\)\ **Version history:**\ 3.1.0 - added -### `updated_at` +### `updated_at` {#updated_at} **Description:** When the announcement was last updated.\ **Type:** String \(ISO 8601 Datetime\)\ **Version history:**\ 3.1.0 - added +### `read` + +**Description:** Whether the announcement has been read by the user.\ +**Type:** Boolean\ +**Version history:**\ +3.1.0 - added + +### `reactions` + +**Description:** Emoji reactions attached to the announcement.\ +**Type:** Array of AnnouncementReaction\ +**Version history:**\ +3.1.0 - added + + ## Optional attributes -### `scheduled_at` +### `scheduled_at` {#scheduled_at} **Description:** When the future announcement was scheduled.\ **Type:** String \(ISO 8601 Datetime\)\ **Version history:**\ 3.1.0 - added -### `starts_at` +### `starts_at` {#starts_at} **Description:** When the future announcement will start.\ **Type:** String \(ISO 8601 Datetime\)\ **Version history:**\ 3.1.0 - added -### `ends_at` +### `ends_at` {#ends_at} **Description:** When the future announcement will end.\ **Type:** String \(ISO 8601 Datetime\)\ diff --git a/content/en/entities/announcementReaction.md b/content/en/entities/announcementReaction.md new file mode 100644 index 00000000..585078d3 --- /dev/null +++ b/content/en/entities/announcementReaction.md @@ -0,0 +1,62 @@ +--- +title: AnnouncementReaction +description: Represents an emoji reaction to an Announcement. +menu: + docs: + parent: entities +--- + +## Example +```javascript +{ + "name": "bongoCat", + "count": 9, + "me": false, + "url": "https://files.mastodon.social/custom_emojis/images/000/067/715/original/fdba57dff7576d53.png", + "static_url": "https://files.mastodon.social/custom_emojis/images/000/067/715/static/fdba57dff7576d53.png" +}, +{ + "name": "🤔", + "count": 1, + "me": true +} +``` + +## Base attributes + +### `name` + +**Description:** The emoji used for the reaction. Either a unicode emoji, or a custom emoji's shortcode.\ +**Type:** String\ +**Version history:**\ +3.1.0 - added + +### `count` + +**Description:** The total number of users who have added this reaction.\ +**Type:** Number\ +**Version history:**\ +3.1.0 - added + +### `me` + +**Description:** Whether the authorized user has added this reaction to the announcement.\ +**Type:** Boolean\ +**Version history:**\ +3.1.0 - added + +## Custom emoji attributes + +### `url` + +**Description:** A link to the custom emoji.\ +**Type:** String \(URL\)\ +**Version history:**\ +3.1.0 - added + +### `static_url` {#static_url} + +**Description:** A link to a non-animated version of the custom emoji.\ +**Type:** String \(URL\)\ +**Version history:**\ +3.1.0 - added \ No newline at end of file diff --git a/content/en/methods/announcements.md b/content/en/methods/announcements.md index 6083b139..3a9eb125 100644 --- a/content/en/methods/announcements.md +++ b/content/en/methods/announcements.md @@ -40,7 +40,50 @@ Currently active announcements ```javascript - +[ + { + "id": "8", + "content": "

Looks like there was an issue processing audio attachments without embedded art since yesterday due to an experimental new feature. That issue has now been fixed, so you may see older posts with audio from other servers pop up in your feeds now as they are being finally properly processed. Sorry!

", + "starts_at": null, + "ends_at": null, + "all_day": false, + "published_at": "2020-07-03T01:27:38.726Z", + "updated_at": "2020-07-03T01:27:38.752Z", + "read": true, + "mentions": [], + "statuses": [], + "tags": [], + "emojis": [], + "reactions": [ + { + "name": "bongoCat", + "count": 9, + "me": false, + "url": "https://files.mastodon.social/custom_emojis/images/000/067/715/original/fdba57dff7576d53.png", + "static_url": "https://files.mastodon.social/custom_emojis/images/000/067/715/static/fdba57dff7576d53.png" + }, + { + "name": "thonking", + "count": 1, + "me": false, + "url": "https://files.mastodon.social/custom_emojis/images/000/098/690/original/a8d36edc4a7032e8.png", + "static_url": "https://files.mastodon.social/custom_emojis/images/000/098/690/static/a8d36edc4a7032e8.png" + }, + { + "name": "AAAAAA", + "count": 1, + "me": false, + "url": "https://files.mastodon.social/custom_emojis/images/000/071/387/original/AAAAAA.png", + "static_url": "https://files.mastodon.social/custom_emojis/images/000/071/387/static/AAAAAA.png" + }, + { + "name": "🤔", + "count": 1, + "me": true + } + ] + } +] ``` {{< endapi-method-response-example >}} {{< endapi-method-response >}} @@ -79,7 +122,7 @@ Local ID of an announcement in the database. ```javascript - +{} ``` {{< endapi-method-response-example >}} {{< endapi-method-response >}} @@ -121,7 +164,16 @@ Unicode emoji, or shortcode of custom emoji ```javascript +{} +``` +{{< endapi-method-response-example >}} +{{< api-method-response-example httpCode=422 >}} +{{< api-method-response-example-description >}} +{{< endapi-method-response-example-description >}} + +```javascript +{"error":"Validation failed: Name is not a recognized emoji"} ``` {{< endapi-method-response-example >}} {{< endapi-method-response >}} @@ -162,7 +214,16 @@ Unicode emoji, or shortcode of custom emoji ```javascript +{} +``` +{{< endapi-method-response-example >}} +{{< api-method-response-example httpCode=422 >}} +{{< api-method-response-example-description >}} +{{< endapi-method-response-example-description >}} + +```javascript +{"error":"Validation failed: Name is not a recognized emoji"} ``` {{< endapi-method-response-example >}} {{< endapi-method-response >}}