mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
feat(api): ✨ Add user emoji upload capabilities
This commit is contained in:
parent
980f4c8021
commit
da2520e60e
36 changed files with 5440 additions and 3340 deletions
|
|
@ -1,6 +1,6 @@
|
|||
# Emoji API
|
||||
|
||||
An Emoji API is made available to administrators to manage custom emoji on the instance. We recommend using Lysand's CLI to manage emoji, but this API is available for those who prefer to use it.
|
||||
An Emoji API is made available to users to manage custom emoji on the instance. We recommend using Lysand's CLI to manage emoji, but this API is available for those who prefer to use it (both admin and non-admin users).
|
||||
|
||||
## Create Emoji
|
||||
|
||||
|
|
@ -8,7 +8,7 @@ An Emoji API is made available to administrators to manage custom emoji on the i
|
|||
POST /api/v1/emojis
|
||||
```
|
||||
|
||||
Creates a new custom emoji on the instance.
|
||||
Creates a new custom emoji on the instance. If the user is an administrator, they can create global emoji that are visible to all users on the instance. Otherwise, the emoji will only be visible to the user who created it (in `/api/v1/custom_emojis`).
|
||||
|
||||
### Parameters
|
||||
|
||||
|
|
@ -17,7 +17,9 @@ Creates a new custom emoji on the instance.
|
|||
- `shortcode`: string, required. The shortcode for the emoji. Must be 2-64 characters long and contain only alphanumeric characters, dashes, and underscores.
|
||||
- `element`: string or file, required. The image file for the emoji. This can be a URL or a file upload.
|
||||
- `alt`: string, optional. The alt text for the emoji. Defaults to the shortcode.
|
||||
|
||||
- `global`: boolean, optional. For administrators only. Whether the emoji should be visible to all users on the instance. Defaults to `false`.
|
||||
- `category`: string, optional. The category for the emoji. Maximum 64 characters.
|
||||
|
||||
### Response
|
||||
|
||||
```ts
|
||||
|
|
@ -28,8 +30,7 @@ Creates a new custom emoji on the instance.
|
|||
url: string,
|
||||
static_url: string,
|
||||
visible_in_picker: boolean,
|
||||
// Lysand does not have a category system for emoji yet, so this is always undefined.
|
||||
category: undefined,
|
||||
category: string | undefined,
|
||||
}
|
||||
```
|
||||
|
||||
|
|
@ -51,7 +52,7 @@ Retrieves information about a custom emoji on the instance.
|
|||
url: string,
|
||||
static_url: string,
|
||||
visible_in_picker: boolean,
|
||||
category: undefined,
|
||||
category: string | undefined,
|
||||
}
|
||||
```
|
||||
|
||||
|
|
@ -70,6 +71,8 @@ Edits a custom emoji on the instance.
|
|||
- `shortcode`: string, optional. The new shortcode for the emoji. Must be 2-64 characters long and contain only alphanumeric characters, dashes, and underscores.
|
||||
- `element`: string or file, optional. The new image file for the emoji. This can be a URL or a file upload.
|
||||
- `alt`: string, optional. The new alt text for the emoji. Defaults to the shortcode.
|
||||
- `global`: boolean, optional. For administrators only. Whether the emoji should be visible to all users on the instance. Defaults to `false`.
|
||||
- `category`: string, optional. The new category for the emoji. Maximum 64 characters.
|
||||
|
||||
### Response
|
||||
|
||||
|
|
@ -81,7 +84,7 @@ Edits a custom emoji on the instance.
|
|||
url: string,
|
||||
static_url: string,
|
||||
visible_in_picker: boolean,
|
||||
category: undefined,
|
||||
category: string | undefined,
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue