DownloadButton adds back Download Button to top right corner of files. (EquicordHelper) (#813)

* Add DownloadButton plugin

* Move download button patch into EquicordHelper

* Address review: remove trailing period

* Add omaw to EquicordHelper authors

* fix restartNeeded

* Update index.tsx

---------

Co-authored-by: thororen1234 <78185467+thororen1234@users.noreply.github.com>
This commit is contained in:
Eazvy 2026-02-20 16:04:52 -05:00 • committed by GitHub
parent 896b8644d1
commit cd125be7e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -97,15 +97,21 @@ const settings = definePluginSettings({
accountStandingButton: {
type: OptionType.BOOLEAN,
description: "Show an account standing button in the header bar",
default: false,
restartNeeded: true,
}
default: false,
},
restoreFileDownloadButton: {
type: OptionType.BOOLEAN,
description: "Adds back the Download button at the top right corner of files",
restartNeeded: true,
default: false
},
});
export default definePlugin({
name: "EquicordHelper",
description: "Used to provide support, fix discord caused crashes, and other misc features.",
authors: [Devs.thororen, EquicordDevs.nyx, EquicordDevs.Naibuu, EquicordDevs.keircn, EquicordDevs.SerStars, EquicordDevs.mart],
authors: [Devs.thororen, EquicordDevs.nyx, EquicordDevs.Naibuu, EquicordDevs.keircn, EquicordDevs.SerStars, EquicordDevs.mart, EquicordDevs.omaw],
required: true,
settings,
headerBarButton: {
@ -164,6 +170,7 @@ export default definePlugin({
replace: "true||$&"
},
},
// Show your own activity buttons because discord removes them for who knows why
{
find: ".USER_PROFILE_ACTIVITY_BUTTONS),",
predicate: () => settings.store.showYourOwnActivityButtons && !isPluginEnabled(customRPC.name),
@ -200,6 +207,15 @@ export default definePlugin({
replace: "1"
}
},
// Restore File Download Button
{
predicate: () => settings.store.restoreFileDownloadButton,
find: '"VISUAL_PLACEHOLDER":',
replacement: {
match: /(\.downloadUrl,showDownload:)\i/,
replace: "$1!0"
}
},
],
renderMessageAccessory(props) {
return (