I’m currently building a discord JS bot to host an art server and I’m working on a command to allow users to upload their own reference photos to a designated #references channel. Users cannot type in this channel, only the bot. I was able to build this functionality where users can call the /submit
function and upload one image at a time, but is there a way to accept n different images within one slash command?
My SlashCommandBuilder looks like this (with some additional for things like a description or who to credit for the image):
module.exports = {
data: new SlashCommandBuilder()
.setName('submitref')
.setDescription('Submit a reference photo to the server.')
.addAttachmentOption(option =>
option
.setName('ref')
.setDescription('Reference Photo')
.setRequired(true)
)
I tried using the existing implementation and ‘ctrl+click’ing multiple images from my local to see if the parameter would accept multiple files, but it seems to only accept 1 image at a time.
I could instead modify the command and take (e.g.) 4 additional optional images as separate parameters, but the ideal solution from a user experience perspective here would be to be able to ‘ctrl click’ multiple files and upload in one go.