New File Upload (Expression) — DiSky

Addon: DiSky · Category: Expression · Since: 5.0.0-a1

Syntax

[a] new file upload from [local] file %text% [(named|with [the] name) %text%] [with spoiler %boolean (yes/no)%]

Description

A file to send to Discord, from a local file path, a URL, or an attachment of a received message (an image too, when SkImage2 is installed). The name defaults to the file's own; 'with spoiler' hides it behind a spoiler. Nothing is read or downloaded until the message carrying it is sent.

Examples

set {_f} to a new file upload from file "plugins/DiSky/logo.png"
set {_f} to a new file upload from url "https://example.com/image.png" named "custom.png"
set {_f} to a new file upload from attachment {_attachment} with spoiler true
add {_f} to attachments of {_message}

View source