i hate this, fix attachment sending in dms by tricking dd into doing it right

This commit is contained in:
Ean Milligan 2025-07-17 02:58:31 -04:00
parent 65fc9e56de
commit 3146f2bc96
1 changed files with 12 additions and 7 deletions

View File

@ -194,14 +194,18 @@ As anyone with the Web View link can view the roll, Web View is disabled by defa
},
];
// HOTFIX: makes discordeno actually be able to reply to any message (user or bot) while in dms
newMsg.guildId = 1n;
if (pubAttachments.map((file) => file.blob.size).reduce(basicReducer, 0) < config.maxFileSize) {
// All attachments will fit in one message
newMsg &&
newMsg
.reply({
embeds: respMessage,
file: pubAttachments,
})
.then((attachmentMsg) => toggleWebView(attachmentMsg, getUserIdForEmbed(rollRequest).toString(), false));
.then((attachmentMsg) => toggleWebView(attachmentMsg, getUserIdForEmbed(rollRequest).toString(), false))
.catch((e) => console.log(e));
} else {
pubAttachments.forEach((file) => {
newMsg &&
@ -210,7 +214,8 @@ As anyone with the Web View link can view the roll, Web View is disabled by defa
embeds: respMessage,
file,
})
.then((attachmentMsg) => toggleWebView(attachmentMsg, getUserIdForEmbed(rollRequest).toString(), false));
.then((attachmentMsg) => toggleWebView(attachmentMsg, getUserIdForEmbed(rollRequest).toString(), false))
.catch((e) => console.log(e));
});
}
}