File uploads will now be sent as attachments

This commit is contained in:
DJj123dj
2026-06-01 19:14:08 +02:00
parent becf0ee50d
commit 97a7a966c8
2 changed files with 12 additions and 2 deletions
+1 -1
View File
@@ -26,7 +26,7 @@
"license": "GPL-3.0-only", "license": "GPL-3.0-only",
"dependencies": { "dependencies": {
"@discordjs/rest": "^2.6.1", "@discordjs/rest": "^2.6.1",
"@open-discord-bots/framework": "^2.0.0", "@open-discord-bots/framework": "^2.0.2",
"@types/node": "^22.5.0", "@types/node": "^22.5.0",
"@types/terminal-kit": "^2.5.7", "@types/terminal-kit": "^2.5.7",
"ansis": "^4.2.0", "ansis": "^4.2.0",
+11 -1
View File
@@ -194,8 +194,18 @@ export async function registerActions(){
//pin ticket message (if required) //pin ticket message (if required)
if (generalConfig.data.ticketSystem.pinFirstTicketMessage && ticketMsg.pinnable) await ticketMsg.pin("Ticket Message") if (generalConfig.data.ticketSystem.pinFirstTicketMessage && ticketMsg.pinnable) await ticketMsg.pin("Ticket Message")
//send modal file upload answers in separate message to prevent deletion after 72h
const attachments = answers
.filter((answer) => answer.type == "file-upload")
.map((answer) => answer.files).flat()
.map((file) => new discord.AttachmentBuilder(file.url,{
name:file.name,
description:file.description ?? undefined
}))
if (attachments.length > 0) await channel.send({files:attachments})
//manage stats //manage stats
await opendiscord.statistics.get("opendiscord:ticket").setStat("opendiscord:messages-sent",ticket.id.value,1,"increase") await opendiscord.statistics.get("opendiscord:ticket").setStat("opendiscord:messages-sent",ticket.id.value,2,"increase")
await opendiscord.events.get("afterTicketMainMessageCreated").emit([ticket,ticketMsg,channel,user]) await opendiscord.events.get("afterTicketMainMessageCreated").emit([ticket,ticketMsg,channel,user])
}catch(err){ }catch(err){