mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 21:45:31 +09:00
feat(guild): require opt-in for emoji and sticker cloning (#2712)
This commit is contained in:
1 parent
7b15e5be0f
commit
3affd295e8
63 files changed
+4189
-1752
No files matched your search
@@ -43,7 +43,7 @@ One custom emoji, readable from outside its guild. It adds the owning guild to t
|
||||
|
||||
<sup>4</sup> Fluxer detects this from the submitted image at creation, and the value never changes
|
||||
|
||||
<sup>5</sup> False exactly when the owning guild has [CLONE_EMOJI_DISABLED](/http-api/guilds/#guild-features)
|
||||
<sup>5</sup> True exactly when the owning guild has [CLONE_EMOJI_ENABLED](/http-api/guilds/#guild-features), and false for every other guild
|
||||
|
||||
Every member is always present, and no member is nullable.
|
||||
|
||||
@@ -81,7 +81,7 @@ One sticker, readable from outside its guild. It adds the owning guild to the [g
|
||||
|
||||
<sup>4</sup> Fluxer detects this from the submitted image at creation, and the value never changes
|
||||
|
||||
<sup>5</sup> False exactly when the owning guild has [CLONE_STICKER_DISABLED](/http-api/guilds/#guild-features)
|
||||
<sup>5</sup> True exactly when the owning guild has [CLONE_STICKER_ENABLED](/http-api/guilds/#guild-features), and false for every other guild
|
||||
|
||||
Every member is always present, and no member is nullable.
|
||||
|
||||
@@ -119,7 +119,7 @@ Returns the [emoji metadata object](#emoji-metadata-object) of any guild emoji.
|
||||
<sup>1</sup> The [error code](/http-api/errors/) is `UNKNOWN_EMOJI` for a missing emoji and `UNKNOWN_GUILD` when the emoji record survives but its guild does not
|
||||
|
||||
:::caution[Cloning reads the emoji's guild again]
|
||||
[Clone guild emoji](/http-api/guild-emojis/#clone-guild-emoji) resolves the source emoji and the source guild again. When the source guild disables cloning between the two calls, the clone fails with 403 `MISSING_ACCESS`.
|
||||
[Clone guild emoji](/http-api/guild-emojis/#clone-guild-emoji) resolves the source emoji and the source guild again. When the source guild drops `CLONE_EMOJI_ENABLED` between the two calls, the clone fails with 403 `MISSING_ACCESS`.
|
||||
:::
|
||||
|
||||
### Rate limit
|
||||
@@ -148,7 +148,7 @@ Returns the [sticker metadata object](#sticker-metadata-object) of any guild sti
|
||||
<sup>1</sup> The [error code](/http-api/errors/) is `UNKNOWN_STICKER` for a missing sticker and `UNKNOWN_GUILD` when the sticker record survives but its guild does not
|
||||
|
||||
:::caution[Cloning reads the sticker's guild again]
|
||||
[Clone guild sticker](/http-api/guild-stickers/#clone-guild-sticker) resolves the source sticker and the source guild again. When the source guild disables cloning between the two calls, the clone fails with 403 `MISSING_ACCESS`.
|
||||
[Clone guild sticker](/http-api/guild-stickers/#clone-guild-sticker) resolves the source sticker and the source guild again. When the source guild drops `CLONE_STICKER_ENABLED` between the two calls, the clone fails with 403 `MISSING_ACCESS`.
|
||||
:::
|
||||
|
||||
### Rate limit
|
||||
|
||||
@@ -240,9 +240,9 @@ Each successful item consumes one guild emoji slot, stores its image, and writes
|
||||
|
||||
Copies an existing emoji into the target guild and returns the new [guild emoji object](#guild-emoji-object) without `user`. Requires membership of the target guild and [CREATE_EXPRESSIONS](/http-api/permissions/) there. Emits a [Guild Emojis Update](/gateway/events/#guild-emojis-update) Gateway event in the target guild.
|
||||
|
||||
The name, animation state, and stored image bytes are copied server-side, so the caller does not re-upload the image and cannot override any copied value. Membership of the source guild is not required. The source guild must not have [CLONE_EMOJI_DISABLED](/http-api/guilds/#guild-features).
|
||||
The name, animation state, and stored image bytes are copied server-side, so the caller does not re-upload the image and cannot override any copied value. Membership of the source guild is not required. The source guild must have [CLONE_EMOJI_ENABLED](/http-api/guilds/#guild-features), which a guild holds only after it opts in.
|
||||
|
||||
An unknown source emoji is reported first, then a source guild that is missing or that disables cloning, then target membership and permission, and only then the target slot limit. [Get emoji metadata](/http-api/expressions/#get-emoji-metadata) reports whether a source permits cloning without attempting the operation.
|
||||
An unknown source emoji is reported first, then a source guild that is missing or that does not permit cloning, then target membership and permission, and only then the target slot limit. [Get emoji metadata](/http-api/expressions/#get-emoji-metadata) reports whether a source permits cloning without attempting the operation.
|
||||
|
||||
The copied bytes are not re-scanned against the banned asset hash list.
|
||||
|
||||
@@ -264,16 +264,16 @@ The copied bytes are not re-scanned against the banned asset hash list.
|
||||
| --- | --- | --- |
|
||||
| 200 | [guild emoji](#guild-emoji-object) object | Emoji was cloned |
|
||||
| 400<sup>1</sup> | [error response](/http-api/#error-response) | Target guild is at its emoji slot limit |
|
||||
| 403<sup>2</sup> | [error response](/http-api/#error-response) | Source guild is missing or disables cloning, the target guild is unavailable, or the caller is not a member of the target guild or lacks `CREATE_EXPRESSIONS` there |
|
||||
| 403<sup>2</sup> | [error response](/http-api/#error-response) | Source guild is missing or does not permit cloning, the target guild is unavailable, or the caller is not a member of the target guild or lacks `CREATE_EXPRESSIONS` there |
|
||||
| 404<sup>3</sup> | [error response](/http-api/#error-response) | Source emoji or target guild does not exist |
|
||||
|
||||
<sup>1</sup> The [error code](/http-api/errors/) is `MAX_EMOJIS`
|
||||
|
||||
<sup>2</sup> The [error code](/http-api/errors/) is `MISSING_ACCESS` when the source guild is missing or has `CLONE_EMOJI_DISABLED` and when the target guild is unavailable, and `MISSING_PERMISSIONS` for a target membership or permission failure
|
||||
<sup>2</sup> The [error code](/http-api/errors/) is `MISSING_ACCESS` when the source guild is missing or lacks `CLONE_EMOJI_ENABLED` and when the target guild is unavailable, and `MISSING_PERMISSIONS` for a target membership or permission failure
|
||||
|
||||
<sup>3</sup> The [error code](/http-api/errors/) is `UNKNOWN_EMOJI` for the source emoji and `UNKNOWN_GUILD` for the target guild
|
||||
|
||||
A source guild that no longer exists returns 403 `MISSING_ACCESS`, so a caller cannot tell it apart from a source guild that disables cloning.
|
||||
A source guild that no longer exists returns 403 `MISSING_ACCESS`, so a caller cannot tell it apart from a source guild that does not permit cloning.
|
||||
|
||||
### Side effects
|
||||
|
||||
|
||||
@@ -262,7 +262,7 @@ Fluxer emits one [Guild Stickers Update](/gateway/events/#guild-stickers-update)
|
||||
|
||||
Copies an existing sticker into the target guild and returns the new [guild sticker object](#guild-sticker-object) without `user`. Emits a [Guild Stickers Update](/gateway/events/#guild-stickers-update) Gateway event in the target guild.
|
||||
|
||||
The caller needs membership of the target guild and [CREATE_EXPRESSIONS](/http-api/permissions/) there. Membership of the source guild is not required. The source guild must not have [CLONE_STICKER_DISABLED](/http-api/guilds/#guild-features).
|
||||
The caller needs membership of the target guild and [CREATE_EXPRESSIONS](/http-api/permissions/) there. Membership of the source guild is not required. The source guild must have [CLONE_STICKER_ENABLED](/http-api/guilds/#guild-features), which a guild holds only after it opts in.
|
||||
|
||||
The name, description, tags, animation state, and stored image bytes are copied server-side, so the caller does not re-upload the image and cannot override any copied value.
|
||||
|
||||
@@ -288,16 +288,16 @@ The availability gate on the target guild runs first. An unknown source sticker
|
||||
| --- | --- | --- |
|
||||
| 200 | [guild sticker](#guild-sticker-object) object | Sticker was cloned |
|
||||
| 400<sup>1</sup> | [error response](/http-api/#error-response) | Target guild is at its sticker slot limit |
|
||||
| 403<sup>2</sup> | [error response](/http-api/#error-response) | Source guild is missing or disables cloning, the target guild is unavailable, or the caller is not a member of the target guild or lacks `CREATE_EXPRESSIONS` there |
|
||||
| 403<sup>2</sup> | [error response](/http-api/#error-response) | Source guild is missing or does not permit cloning, the target guild is unavailable, or the caller is not a member of the target guild or lacks `CREATE_EXPRESSIONS` there |
|
||||
| 404<sup>3</sup> | [error response](/http-api/#error-response) | Source sticker or target guild does not exist |
|
||||
|
||||
<sup>1</sup> The [error code](/http-api/errors/) is `MAX_STICKERS`
|
||||
|
||||
<sup>2</sup> The [error code](/http-api/errors/) is `MISSING_ACCESS` when the source guild is missing or has `CLONE_STICKER_DISABLED` and when the target guild is unavailable, and `MISSING_PERMISSIONS` for a target membership or permission failure
|
||||
<sup>2</sup> The [error code](/http-api/errors/) is `MISSING_ACCESS` when the source guild is missing or lacks `CLONE_STICKER_ENABLED` and when the target guild is unavailable, and `MISSING_PERMISSIONS` for a target membership or permission failure
|
||||
|
||||
<sup>3</sup> The [error code](/http-api/errors/) is `UNKNOWN_STICKER` for the source sticker and `UNKNOWN_GUILD` for the target guild
|
||||
|
||||
A source guild that no longer exists returns 403 `MISSING_ACCESS`, so a caller cannot tell it apart from a source guild that disables cloning.
|
||||
A source guild that no longer exists returns 403 `MISSING_ACCESS`, so a caller cannot tell it apart from a source guild that does not permit cloning.
|
||||
|
||||
### Side effects
|
||||
|
||||
|
||||
@@ -382,8 +382,10 @@ Each value in the guild's `features` array is a capability or availability flag.
|
||||
| AUDIO_BITRATE_256_KBPS<sup>6</sup> | Voice channel bitrate ceiling is raised to 256000 |
|
||||
| AUDIO_BITRATE_384_KBPS<sup>6</sup> | Voice channel bitrate ceiling is raised to 384000 |
|
||||
| BANNER | Guild can use a banner |
|
||||
| CLONE_EMOJI_DISABLED<sup>1</sup> | The one-click emoji clone shortcut is disabled for non-members |
|
||||
| CLONE_STICKER_DISABLED<sup>1</sup> | The one-click sticker clone shortcut is disabled for non-members |
|
||||
| CLONE_EMOJI_DISABLED<sup>7</sup> | Deprecated. Emoji cloning now needs CLONE_EMOJI_ENABLED |
|
||||
| CLONE_EMOJI_ENABLED<sup>1</sup> | Guild permits another guild to clone its emojis |
|
||||
| CLONE_STICKER_DISABLED<sup>7</sup> | Deprecated. Sticker cloning now needs CLONE_STICKER_ENABLED |
|
||||
| CLONE_STICKER_ENABLED<sup>1</sup> | Guild permits another guild to clone its stickers |
|
||||
| DETACHED_BANNER<sup>1</sup> | Guild banner is independent from its splash |
|
||||
| INVITE_SPLASH | Guild can use invite splash assets |
|
||||
| INVITES_DISABLED<sup>1</sup> | Guild invite use is disabled |
|
||||
@@ -420,6 +422,12 @@ Each value in the guild's `features` array is a capability or availability flag.
|
||||
|
||||
<sup>6</sup> A guild holding none of the three caps a voice channel `bitrate` at 96000. The highest feature the guild holds wins, and a write above the cap is stored at the cap rather than rejected. A guild that loses the feature keeps the stored value, and the next write to `bitrate` lowers it to the cap
|
||||
|
||||
<sup>7</sup> The feature is deprecated and changes no behaviour. Fluxer still returns it for a guild that already holds it, and [Modify guild](#modify-guild) can neither add nor remove it
|
||||
|
||||
:::caution[Expression cloning is opt-in]
|
||||
`CLONE_EMOJI_ENABLED` and `CLONE_STICKER_ENABLED` replace the deprecated `CLONE_EMOJI_DISABLED` and `CLONE_STICKER_DISABLED`, and they are now the only features that permit cloning. A guild that holds neither refuses every clone of its emojis and stickers, so cloning is off until a member with `MANAGE_GUILD` adds the feature through [Modify guild](#modify-guild). A guild that once held a deprecated feature and a guild that never held one both start off.
|
||||
:::
|
||||
|
||||
## Custom invite URL object
|
||||
|
||||
A custom invite URL object reports the guild's current custom invite code and how many times the invite behind it has been used. [Get guild custom invite URL](#get-guild-custom-invite-url) returns it.
|
||||
@@ -681,7 +689,7 @@ Every field is optional. An omitted field preserves its current value, and a fie
|
||||
|
||||
<sup>13</sup> A non-null value requires `INVITE_SPLASH` and is rejected with the field codes `INVITE_SPLASH_REQUIRES_FEATURE` or `EMBED_SPLASH_REQUIRES_FEATURE`. Both splash fields take static images only, so GIF and APNG are not accepted for either and an animated upload is rejected with the field code `INVALID_IMAGE_FORMAT`
|
||||
|
||||
<sup>14</sup> Adding a feature that is not user-toggleable is rejected with the field code `GUILD_FEATURE_NOT_TOGGLEABLE`, while omitting a feature that is not user-toggleable leaves it in place. The user-toggleable features are `INVITES_DISABLED`, `TEXT_CHANNEL_FLEXIBLE_NAMES`, `DETACHED_BANNER`, `CLONE_EMOJI_DISABLED`, `CLONE_STICKER_DISABLED`, and `HIDE_OWNER_CROWN`
|
||||
<sup>14</sup> Adding a feature that is not user-toggleable is rejected with the field code `GUILD_FEATURE_NOT_TOGGLEABLE`, while omitting a feature that is not user-toggleable leaves it in place. The user-toggleable features are `INVITES_DISABLED`, `TEXT_CHANNEL_FLEXIBLE_NAMES`, `DETACHED_BANNER`, `CLONE_EMOJI_ENABLED`, `CLONE_STICKER_ENABLED`, and `HIDE_OWNER_CROWN`
|
||||
|
||||
<sup>15</sup> A timestamp earlier than the guild's creation time or in the future is rejected with `MESSAGE_HISTORY_CUTOFF_BEFORE_GUILD_CREATION` or `MESSAGE_HISTORY_CUTOFF_IN_FUTURE`
|
||||
|
||||
|
||||
Reference in new issue
Block a user