Zrzur Developers

Files

Files go to the file server first; messages, avatars and emojis then refer to them by id.

Upload

curl -X POST "https://cdn.zrzur.com/attachments" \
  -H "x-bot-token: $ZRZUR_BOT_TOKEN" \
  -F "[email protected];type=text/csv"

The answer is { "id": "<file id>" }. Send it in attachments of a message, or as avatar, icon, banner or emoji id.

TagUsed forDefault size limit
attachmentsmessage files20 MB
avatarsuser and bot avatars4 MB
iconsserver and channel icons2.5 MB
bannersserver and profile banners6 MB
backgroundsprofile backgrounds6 MB
emojiscustom emojis500 KB

Each server sets its own limits; GET / on the API lists them under features.limits. Except for attachments, only images are accepted. Empty files are refused (FileTooSmall), too big ones get FileTooLarge with the maximum. Uploads need the bot token; the decorations tag is for Zrzur staff only.

Download

Files are served from https://cdn.zrzur.com/{tag}/{file id}/{file name}. Images also have previews at /{tag}/{file id}.

With the SDK

const id = await bot.rest.uploadFile(
  "attachments",
  bytes,
  "report.csv",
  "text/csv",
);
await bot.messages.send(channelId, {
  content: "Report",
  files: [{ name: "report.csv", data: bytes, type: "text/csv" }],
});

The file upload tutorial builds /report.