Skip to content

Uploads Emojis Previews

KOKOTO-DEV edited this page Aug 26, 2026 · 3 revisions

Uploads Emojis Previews

KOKOTO WebChat 5.0.0 · Minecraft 1.18–26.2 · Java 17 baseline

19. File and Clipboard Uploads

upload:
  enabled: true
  allow-guest-upload: false
  allow-user-upload: true
  allow-moderator-upload: true
  allow-admin-upload: true
  cooldown-seconds: 5
  max-uploads-per-minute: 4
  max-file-size-mb: 20
  max-total-size-mb: 0
  max-files-per-message: 3
  directory: "uploads"
  retention-days: 5
  clipboard-upload-enabled: true
  clipboard-upload-send-mode: "insert"

Default extensions:

  • Images: PNG, JPG, JPEG, GIF, WEBP
  • Video: MP4, WEBM
  • Audio: MP3, M4A, OGG, WAV, FLAC

max-total-size-mb: 0 means unlimited. When a positive total limit is used, old unreferenced uploads are cleaned first; the new upload is rejected if space is still insufficient.

Clipboard modes:

  • insert: insert the uploaded URL into the composer
  • send: send immediately after upload

See UPLOAD_SECURITY_EN.md for security guidance.

20. Media and Link Previews

Uploaded media previews:

upload:
  preview-images: true
  preview-videos: true
  preview-audio: true

YouTube:

preview:
  youtube-embed-enabled: true
  youtube-click-to-load: true
  youtube-nocookie: true
  youtube-max-embeds-per-message: 1

YouTube Shorts use the normal YouTube preview path with a vertical layout. ui.image-preview-max-per-message and ui.image-preview-max-height limit the number and height of previews. Google Drive image previews can be enabled with ui.google-drive-image-preview and configured with ui.google-drive-preview-mode.

TikTok and X:

preview:
  social-embeds:
    enabled: true
    click-to-load: true
    max-embeds-per-message: 2
    tiktok:
      enabled: false
    x:
      enabled: false
      theme: "auto"
      dnt: true

External embeds make browser requests to third-party services. Keep click-to-load: true on public servers unless automatic loading is explicitly acceptable.

Discord CDN cache:

preview:
  external-media-cache-enabled: true
  cache-discord-cdn: true
  external-media-cache-retention-days: 5

This preserves previews for expiring Discord attachment URLs.

21. Custom Emoji

emoji:
  enabled: true
  show-button: true
  directory: "emojis"
  max-file-size-kb: 512
  max-total-size-mb: 64
  render-size-px: 32
  picker-size-px: 44
  message-token-limit: 12
  token-format: "short"

File layout:

plugins/KOKOTO-WebChat/emojis/default/wave.png
plugins/KOKOTO-WebChat/emojis/reaction/happy.gif

Tokens:

:default/wave:
:reaction/happy:
:emoji:default/wave:

token-format: short inserts :pack/name:. legacy inserts :emoji:pack/name:. Both formats are accepted for parsing.

Administrators can create folders, select multiple PNG/JPG/JPEG/GIF/WEBP files in one picker operation, upload them immediately through the same validated per-file upload path used by normal chat uploads, rename items, and delete items from the web emoji manager. Multi-file uploads run sequentially and keep the existing per-file validation, storage accounting, unique-name allocation, audit logging, and PNG-sidecar generation. Renaming a file or pack can break rendering of historical messages that contain the old token.

21.1 In-Game Emoji Handling

Default:

emoji:
  game-link:
    enabled: false

This preserves tokens for ImageEmojis-Bero or another game-side renderer.

KWC conversion mode:

emoji:
  game-link:
    enabled: true
    mode: "link"
    label-format: ":{id}:"
    max-links-per-message: 4

Modes:

  • preserve: keep the token
  • label: output only a configured label
  • link: output a label plus a short image URL

22. ImageEmojis-Bero 1.9.x Integration

Recommended ImageEmojis-Bero settings:

emojisFolder: "/KOKOTO-WebChat/emojis"
templateFormat: ":<emoji>:"
replaceInCommands: true

Player permission:

imageemojis.use

replaceInCommands: true is required for token conversion inside /kchat reply, /kchat dm, and /kchat group.

In a relay deployment, every server must have matching pack and file names. KOKOTO WebChat preserves canonical tokens in web history and relay payloads, then uses the receiving server's runtime token-to-glyph map for Minecraft output.

Recommended refresh order after emoji changes:

/emojis reload
/emojis update

Reconnect if the resource pack must be refreshed. See IMAGEEMOJIS_BERO_1_9_0_EN.md for full details.

Administrator Multi-file Emoji Upload

In 4.7.0 the emoji manager deliberately follows the same file-picker handoff as normal chat upload: the visible upload control opens a hidden <input type="file" multiple>, and the selected files are copied/cleared from the native input and uploaded immediately. There is no second upload-confirmation button. Files are sent sequentially through the existing single-file endpoint, preserving extension/size checks, total quota, unique-name handling, audit logging, and PNG-sidecar generation for GIF/JPG/JPEG/WEBP originals.

Original upload filenames

upload.filename-mode is random by default. Set it to original to preserve safe Unicode source filenames for new regular uploads. Unsafe path/control/filesystem characters are sanitized, existing uploads are not renamed, and name collisions use -2, -3, ... suffixes without overwriting an existing file. The option is also available in Web Admin Settings and /kchat settings.

SimpleNicks-Bero integration

SimpleNicks-Bero affects player names rather than uploads. On Bukkit/Paper-family servers, set player-display.mode: "display-name" to show the nickname stored in Bukkit's display name. See docs/SIMPLENICKS_BERO_EN.md and the SimpleNicks-Bero fork.

Clone this wiki locally