File Uploads
File uploads are a new way to handle attachments in DiSky, replacing the previous attachment system. They allow you to upload files from various sources, such as local files, URLs, Discord attachments, or SkImage's Images.
Creating a File Upload
When create a file upload, you can specify a name that will be sent over by discord (that may be different from the original file name) and whether the file should be marked as a spoiler.
Tip
Whatever the source, you can always specify a different name (and spoiler) for the file upload. If none is specified, DiSky will try to find one based on the source (e.g. file name, URL, etc.)
Here's how to create a file upload from different sources:
Using a File Upload
Now you can upload that "file upload" via different contexts, such as:
In a Message
create a new message and store it in {_msg}:
set the content of the message to "This message has an attachment!"
set {_upload} to new file upload from file "plugins/DiSky/assets/image.png" with name "test.png"
add {_upload} to the attachments of the message
reply with {_msg}
# or post the message
As an embed's image
create a new message and store it in {_msg}:
make embed and store it in {_embed}:
set title of embed to "Amazing embeds :D"
set embed color of embed to orange
set image of embed to "attachment://test.png"
add {_embed} to the embeds of the message
set {_a} to new file upload from attachment arg-1 named "test.png" #(1)!
add {_a} to the attachments of the message
reply with {_msg}
- The name of the file upload must match the one specified in the embed's image URL (e.g.
attachment://test.png
).