diff --git a/README.md b/README.md index ddf21f8df..cd18e0017 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ You can join our [discord server](https://discord.gg/equicord-117327988606502929 ### Extra included plugins
-194 additional plugins +195 additional plugins ### All Platforms @@ -151,6 +151,7 @@ You can join our [discord server](https://discord.gg/equicord-117327988606502929 - ReplyPingControl by ant0n & MrDiamond - RPCEditor by Nyako & nin0dev - RPCStats by Samwich +- SaveFavoriteGIFs by thororen - SearchFix by Jaxx - SekaiStickers by MaiKokain - ServerSearch by camila314 diff --git a/src/equicordplugins/encryptcord/index.tsx b/src/equicordplugins/encryptcord/index.tsx index 803da27c7..c92bbae70 100644 --- a/src/equicordplugins/encryptcord/index.tsx +++ b/src/equicordplugins/encryptcord/index.tsx @@ -4,7 +4,7 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import { addChatBarButton, ChatBarButton, ChatBarButtonFactory, removeChatBarButton } from "@api/ChatButtons"; +import { ChatBarButton, ChatBarButtonFactory } from "@api/ChatButtons"; import { ApplicationCommandInputType, ApplicationCommandOptionType, @@ -150,6 +150,7 @@ export default definePlugin({ } } ], + renderChatBarButton: ChatBarIcon, async interactionHandler(interaction) { const sender = await UserUtils.getUser(interaction.application_id).catch(() => null); if (!sender || (sender.bot === true && sender.id !== "1")) return; @@ -260,7 +261,6 @@ export default definePlugin({ }, ], async start() { - addChatBarButton("Encryptcord", ChatBarIcon); const pair = await generateKeys(); await DataStore.set("encryptcordPublicKey", pair.publicKey); await DataStore.set("encryptcordPrivateKey", pair.privateKey); @@ -272,7 +272,6 @@ export default definePlugin({ await DataStore.set("encryptcordGroupMembers", {}); }, async stop() { - removeChatBarButton("Encryptcord"); if (await DataStore.get("encryptcordGroup") === true) { await leave("", { channel: { id: await DataStore.get("encryptcordChannelId") } }); } diff --git a/src/equicordplugins/furudoSpeak.dev/index.tsx b/src/equicordplugins/furudoSpeak.dev/index.tsx index 7db2b2113..9581700e8 100644 --- a/src/equicordplugins/furudoSpeak.dev/index.tsx +++ b/src/equicordplugins/furudoSpeak.dev/index.tsx @@ -4,7 +4,7 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import { addChatBarButton, ChatBarButton, ChatBarButtonFactory, removeChatBarButton } from "@api/ChatButtons"; +import { ChatBarButton, ChatBarButtonFactory } from "@api/ChatButtons"; import { ApplicationCommandInputType, ApplicationCommandOptionType, findOption, sendBotMessage } from "@api/Commands"; import { findGroupChildrenByChildId, NavContextMenuPatchCallback } from "@api/ContextMenu"; import { addMessagePreSendListener, MessageSendListener, removeMessagePreSendListener } from "@api/MessageEvents"; @@ -287,14 +287,13 @@ export default definePlugin({ contextMenus: { "textarea-context": ChatBarContextCheckbox }, + renderChatBarButton: FurudoSpeakChatToggle, start: () => { - addChatBarButton("FurudoSpeak", FurudoSpeakChatToggle); messageSendListenerFuncs(); }, stop: () => { - removeChatBarButton("FurudoSpeak"); removeMessagePreSendListener(presendObject); } }); diff --git a/src/equicordplugins/ingtoninator/index.tsx b/src/equicordplugins/ingtoninator/index.tsx index d5194b36e..0a777f340 100644 --- a/src/equicordplugins/ingtoninator/index.tsx +++ b/src/equicordplugins/ingtoninator/index.tsx @@ -4,7 +4,7 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import { addChatBarButton, ChatBarButton, ChatBarButtonFactory, removeChatBarButton } from "@api/ChatButtons"; +import { ChatBarButton, ChatBarButtonFactory } from "@api/ChatButtons"; import { addMessagePreSendListener, removeMessagePreSendListener } from "@api/MessageEvents"; import { definePluginSettings } from "@api/Settings"; import { EquicordDevs } from "@utils/constants"; @@ -96,12 +96,11 @@ export default definePlugin({ description: "Suffixes 'ington' to a random word in your message", authors: [EquicordDevs.zyqunix], settings, + renderChatBarButton: IngtoninatorButton, start() { - addChatBarButton("Ingtoninator", IngtoninatorButton); addMessagePreSendListener(handleMessage); }, stop() { - removeChatBarButton("Ingtoninator"); removeMessagePreSendListener(handleMessage); } }); diff --git a/src/equicordplugins/meow/index.tsx b/src/equicordplugins/meow/index.tsx index 3a0d93094..a03cf3fe4 100644 --- a/src/equicordplugins/meow/index.tsx +++ b/src/equicordplugins/meow/index.tsx @@ -4,7 +4,7 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import { addChatBarButton, ChatBarButton, ChatBarButtonFactory, removeChatBarButton } from "@api/ChatButtons"; +import { ChatBarButton, ChatBarButtonFactory } from "@api/ChatButtons"; import { Devs } from "@utils/constants"; import { getCurrentChannel, sendMessage } from "@utils/discord"; import definePlugin from "@utils/types"; @@ -28,6 +28,5 @@ export default definePlugin({ description: "Adds a chatbar button to meow in chat", authors: [Devs.Samwich], - start: () => addChatBarButton("Meow", ChatBarIcon), - stop: () => removeChatBarButton("Meow") + renderChatBarButton: ChatBarIcon, }); diff --git a/src/equicordplugins/saveFavoriteGIFs/index.tsx b/src/equicordplugins/saveFavoriteGIFs/index.tsx new file mode 100644 index 000000000..8d263b78b --- /dev/null +++ b/src/equicordplugins/saveFavoriteGIFs/index.tsx @@ -0,0 +1,61 @@ +/* + * Vencord, a Discord client mod + * Copyright (c) 2025 Vendicated and contributors + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +import { ChatBarButton, ChatBarButtonFactory } from "@api/ChatButtons"; +import { showNotification } from "@api/Notifications"; +import { EquicordDevs } from "@utils/constants"; +import definePlugin from "@utils/types"; +import { saveFile } from "@utils/web"; +import { findComponentByCodeLazy } from "@webpack"; +import { UserSettingsActionCreators } from "@webpack/common"; + +const StarIcon = findComponentByCodeLazy(".73-2.25h6.12l1.9-5.83Z"); + +async function saveGifs() { + const filename = `favorite-gifs-${new Date().toISOString().split("T")[0]}.txt`; + const gifUrls = Object.keys(UserSettingsActionCreators.FrecencyUserSettingsActionCreators.getCurrentValue().favoriteGifs.gifs); + const content = gifUrls.join("\n"); + + try { + if (IS_DISCORD_DESKTOP) { + const data = new TextEncoder().encode(content); + await DiscordNative.fileManager.saveWithDialog(data, filename); + } else { + const file = new File([content], filename, { type: "text/plain" }); + saveFile(file); + } + + showNotification({ + title: "Save Favorite GIFs", + body: `Saved GIFs successfully as ${filename}`, + }); + } catch (error) { + showNotification({ + title: "Save Favorite GIFs", + body: "Failed to save GIFs", + }); + } +} + +const button: ChatBarButtonFactory = ({ isMainChat }) => { + if (!isMainChat) return null; + + return ( + saveGifs()} + > + + + ); +}; + +export default definePlugin({ + name: "SaveFavoriteGIFs", + description: "Save favorite GIF urls to a file", + authors: [EquicordDevs.thororen], + renderChatBarButton: button, +}); diff --git a/src/equicordplugins/sekaiStickers/index.tsx b/src/equicordplugins/sekaiStickers/index.tsx index 5b1840f02..bfbc07feb 100644 --- a/src/equicordplugins/sekaiStickers/index.tsx +++ b/src/equicordplugins/sekaiStickers/index.tsx @@ -4,7 +4,7 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import { addChatBarButton, ChatBarButton, ChatBarButtonFactory, removeChatBarButton } from "@api/ChatButtons"; +import { ChatBarButton, ChatBarButtonFactory } from "@api/ChatButtons"; import { definePluginSettings } from "@api/Settings"; import { Devs } from "@utils/constants"; import { openModal } from "@utils/modal"; @@ -36,7 +36,8 @@ export default definePlugin({ authors: [Devs.MaiKokain], dependencies: ["ChatInputButtonAPI"], settings, - start: async () => { + renderChatBarButton: SekaiStickerChatButton, + async start() { const fonts = [{ name: "YurukaStd", url: "https://raw.githubusercontent.com/TheOriginalAyaka/sekai-stickers/47a2ca33b8cb35f59800e8faad48980e4ce5ea71/src/fonts/YurukaStd.woff2" }, { name: "SSFangTangTi", url: "https://raw.githubusercontent.com/TheOriginalAyaka/sekai-stickers/main/src/fonts/ShangShouFangTangTi.woff2" }]; if (!IS_FONTS_LOADED) { fonts.map(n => { @@ -47,7 +48,5 @@ export default definePlugin({ }); IS_FONTS_LOADED = true; } - addChatBarButton("SekaiStickers", SekaiStickerChatButton); }, - stop: () => removeChatBarButton("SekaiStickers") }); diff --git a/src/equicordplugins/signature/index.tsx b/src/equicordplugins/signature/index.tsx index f027ffb40..53b830145 100644 --- a/src/equicordplugins/signature/index.tsx +++ b/src/equicordplugins/signature/index.tsx @@ -4,7 +4,7 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import { addChatBarButton, ChatBarButton, ChatBarButtonFactory, removeChatBarButton } from "@api/ChatButtons"; +import { ChatBarButton, ChatBarButtonFactory } from "@api/ChatButtons"; import { ApplicationCommandInputType, ApplicationCommandOptionType, findOption, sendBotMessage } from "@api/Commands"; import { findGroupChildrenByChildId, NavContextMenuPatchCallback } from "@api/ContextMenu"; import { addMessagePreSendListener, removeMessagePreSendListener } from "@api/MessageEvents"; @@ -106,15 +106,14 @@ export default definePlugin({ description: "Automated fingerprint/end text", authors: [Devs.Ven, Devs.Rini, Devs.ImBanana, EquicordDevs.KrystalSkull], dependencies: ["MessageEventsAPI", "ChatInputButtonAPI"], + renderChatBarButton: SignatureToggle, start: () => { if (settings.store.isEnabled) true; - addChatBarButton("Signature", SignatureToggle); addMessagePreSendListener(handleMessage); }, stop: () => { if (settings.store.isEnabled) false; - removeChatBarButton("Signature"); removeMessagePreSendListener(handleMessage); }, diff --git a/src/equicordplugins/talkInReverse/index.tsx b/src/equicordplugins/talkInReverse/index.tsx index bf50fca8d..7ecf97e5a 100644 --- a/src/equicordplugins/talkInReverse/index.tsx +++ b/src/equicordplugins/talkInReverse/index.tsx @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import { addChatBarButton, ChatBarButton, ChatBarButtonFactory, removeChatBarButton } from "@api/ChatButtons"; +import { ChatBarButton, ChatBarButtonFactory } from "@api/ChatButtons"; import { addMessagePreSendListener, MessageSendListener, removeMessagePreSendListener } from "@api/MessageEvents"; import { EquicordDevs } from "@utils/constants"; import definePlugin from "@utils/types"; @@ -59,7 +59,5 @@ export default definePlugin({ authors: [EquicordDevs.Tolgchu], description: "Reverses the message content before sending it.", dependencies: ["MessageEventsAPI", "ChatInputButtonAPI"], - - start: () => addChatBarButton("ReverseMessageToggle", ReverseMessageToggle), - stop: () => removeChatBarButton("ReverseMessageToggle") + renderChatBarButton: ReverseMessageToggle, }); diff --git a/src/equicordplugins/woof/index.tsx b/src/equicordplugins/woof/index.tsx index 7a06a715e..cdd80ee88 100644 --- a/src/equicordplugins/woof/index.tsx +++ b/src/equicordplugins/woof/index.tsx @@ -4,7 +4,7 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import { addChatBarButton, ChatBarButton, ChatBarButtonFactory, removeChatBarButton } from "@api/ChatButtons"; +import { ChatBarButton, ChatBarButtonFactory } from "@api/ChatButtons"; import { Devs } from "@utils/constants"; import { getCurrentChannel, sendMessage } from "@utils/discord"; import definePlugin from "@utils/types"; @@ -27,6 +27,5 @@ export default definePlugin({ name: "Woof", description: "Adds a chatbar button to woof in chat", authors: [Devs.Samwich], - start: () => addChatBarButton("Woof", ChatBarIcon), - stop: () => removeChatBarButton("Woof") + renderChatBarButton: ChatBarIcon, });