This commit is contained in:
thororen1234 2025-01-22 21:22:25 -05:00
parent acf04bb01d
commit 90d946e7c6
26 changed files with 84 additions and 84 deletions

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { addPreSendListener, removePreSendListener } from "@api/MessageEvents";
import { addMessagePreSendListener, removeMessagePreSendListener } from "@api/MessageEvents";
import { migratePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
@ -34,13 +34,13 @@ export default definePlugin({
}
],
start() {
this.preSend = addPreSendListener((_, msg) => {
this.preSend = addMessagePreSendListener((_, msg) => {
msg.content = msg.content.replace(/@someone/g, () => `<@${randomUser()}>`);
});
},
stop() {
removePreSendListener(this.preSend);
removeMessagePreSendListener(this.preSend);
}
});

View file

@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { addButton, removeButton } from "@api/MessagePopover";
import { addMessagePopoverButton, removeMessagePopoverButton } from "@api/MessagePopover";
import { definePluginSettings } from "@api/Settings";
import { CodeBlock } from "@components/CodeBlock";
import ErrorBoundary from "@components/ErrorBoundary";
@ -116,7 +116,7 @@ export default definePlugin({
},
start() {
addButton("DecodeBase64", msg => {
addMessagePopoverButton("DecodeBase64", msg => {
const handleClick = () => {
const base64Strings = findBase64Strings(msg.content);
const decodedContent = decodeBase64Strings(base64Strings);
@ -157,6 +157,6 @@ export default definePlugin({
},
stop() {
removeButton("DecodeBase64");
removeMessagePopoverButton("DecodeBase64");
}
});

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { addPreSendListener } from "@api/MessageEvents";
import { addMessagePreSendListener } from "@api/MessageEvents";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
import { Alerts, ChannelStore, Forms } from "@webpack/common";
@ -41,7 +41,7 @@ export default definePlugin({
authors: [Devs.Samwich],
dependencies: ["MessageEventsAPI"],
start() {
this.preSend = addPreSendListener(async (channelId, messageObj, extra) => {
this.preSend = addMessagePreSendListener(async (channelId, messageObj, extra) => {
if (ChannelStore.getChannel(channelId.toString()).isDM()) return { cancel: false };

View file

@ -11,7 +11,7 @@ import {
sendBotMessage,
} from "@api/Commands";
import * as DataStore from "@api/DataStore";
import { addPreSendListener, removePreSendListener, SendListener } from "@api/MessageEvents";
import { addMessagePreSendListener, removeMessagePreSendListener, SendListener } from "@api/MessageEvents";
import { Devs } from "@utils/constants";
import { sleep } from "@utils/misc";
import definePlugin from "@utils/types";
@ -72,8 +72,8 @@ const ChatBarIcon: ChatBarButton = ({ isMainChat }) => {
}
};
addPreSendListener(listener);
return () => void removePreSendListener(listener);
addMessagePreSendListener(listener);
return () => void removeMessagePreSendListener(listener);
}, [enabled]);
if (!isMainChat) return null;

View file

@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { addButton, removeButton } from "@api/MessagePopover";
import { addMessagePopoverButton, removeMessagePopoverButton } from "@api/MessagePopover";
import { disableStyle, enableStyle } from "@api/Styles";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
@ -72,7 +72,7 @@ export default definePlugin({
authors: [Devs.newwares],
start() {
enableStyle(styles);
addButton("vc-findreply", message => {
addMessagePopoverButton("vc-findreply", message => {
if (!message.id) return null;
const replies = findReplies(message);
if (Vencord.Settings.plugins.FindReply.hideButtonIfNoReply && !replies.length) return null;
@ -117,7 +117,7 @@ export default definePlugin({
});
},
stop() {
removeButton("vc-findreply");
removeMessagePopoverButton("vc-findreply");
root && root.unmount();
element?.remove();
disableStyle(styles);

View file

@ -148,10 +148,10 @@ export default definePlugin({
description: "Adds badges showcasing how long you have been friends with a user for",
authors: [Devs.Samwich],
start() {
getBadgesToApply().forEach(thing => Vencord.Api.Badges.addBadge(thing));
getBadgesToApply().forEach(thing => Vencord.Api.Badges.addProfileBadge(thing));
},
stop() {
getBadgesToApply().forEach(thing => Vencord.Api.Badges.removeBadge(thing));
getBadgesToApply().forEach(thing => Vencord.Api.Badges.removeProfileBadge(thing));
},
});

View file

@ -7,7 +7,7 @@
import { addChatBarButton, ChatBarButton, removeChatBarButton } from "@api/ChatButtons";
import { ApplicationCommandInputType, ApplicationCommandOptionType, findOption, sendBotMessage } from "@api/Commands";
import { findGroupChildrenByChildId, NavContextMenuPatchCallback } from "@api/ContextMenu";
import { addPreSendListener, removePreSendListener, SendListener } from "@api/MessageEvents";
import { addMessagePreSendListener, removeMessagePreSendListener, SendListener } from "@api/MessageEvents";
import { definePluginSettings, Settings } from "@api/Settings";
import { ErrorCard } from "@components/ErrorCard";
import { Link } from "@components/Link";
@ -96,9 +96,9 @@ const furudosettings = definePluginSettings(
function messageSendListenerFuncs() {
if (furudosettings.store.isEnabled) {
addPreSendListener(presendObject);
addMessagePreSendListener(presendObject);
} else {
removePreSendListener(presendObject);
removeMessagePreSendListener(presendObject);
}
}
@ -243,6 +243,6 @@ export default definePlugin({
stop: () => {
removeChatBarButton("FurudoSpeak");
removePreSendListener(presendObject);
removeMessagePreSendListener(presendObject);
}
});

View file

@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { addBadge, BadgePosition, ProfileBadge, removeBadge } from "@api/Badges";
import { addProfileBadge, BadgePosition, ProfileBadge, removeProfileBadge } from "@api/Badges";
import { classNameFactory } from "@api/Styles";
import ErrorBoundary from "@components/ErrorBoundary";
import { Devs, EquicordDevs } from "@utils/constants";
@ -137,8 +137,8 @@ export default definePlugin({
description: "Adds global badges from other client mods",
authors: [Devs.HypedDomi, EquicordDevs.Wolfie],
start: () => addBadge(Badge),
stop: () => removeBadge(Badge),
start: () => addProfileBadge(Badge),
stop: () => removeProfileBadge(Badge),
options: {
showPrefix: {

View file

@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { addPreSendListener, removePreSendListener } from "@api/MessageEvents";
import { addMessagePreSendListener, removeMessagePreSendListener } from "@api/MessageEvents";
import { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
@ -77,13 +77,13 @@ export default definePlugin({
}
}),
async start() {
this.preSend = addPreSendListener((_channelId, msg) => {
this.preSend = addMessagePreSendListener((_channelId, msg) => {
const newContent = this.replaceBadVerbs(this.replaceBadNouns(msg.content));
msg.content = newContent;
});
},
stop() {
removePreSendListener(this.preSend);
removeMessagePreSendListener(this.preSend);
},
getEnabledBadNouns() {
const thingToReturn: string[] = [];

View file

@ -8,7 +8,7 @@ import "./styles.css";
import { NavContextMenuPatchCallback } from "@api/ContextMenu";
import { get, set } from "@api/DataStore";
import { addAccessory, removeAccessory } from "@api/MessageAccessories";
import { addMessageAccessory, removeMessageAccessory } from "@api/MessageAccessories";
import { definePluginSettings } from "@api/Settings";
import { classNameFactory } from "@api/Styles";
import { EquicordDevs } from "@utils/constants";
@ -147,7 +147,7 @@ export default definePlugin({
buildCss();
}
addAccessory("vc-hide-message", ({ message }) => {
addMessageAccessory("vc-hide-message", ({ message }) => {
if (hiddenMessages.has(message.id) && settings.store.showNotice) return <HideMessageAccessory id={message.id} />;
return null;
});
@ -156,7 +156,7 @@ export default definePlugin({
async stop() {
for (const id of hiddenMessages.keys()) revealMessage(id);
removeAccessory("vc-hide-message");
removeMessageAccessory("vc-hide-message");
style.remove();
hiddenMessages.clear();

View file

@ -20,7 +20,7 @@ import "./style.css";
import { NavContextMenuPatchCallback } from "@api/ContextMenu";
import { DataStore } from "@api/index";
import { addButton, removeButton } from "@api/MessagePopover";
import { addMessagePopoverButton, removeMessagePopoverButton } from "@api/MessagePopover";
import ErrorBoundary from "@components/ErrorBoundary";
import { EquicordDevs } from "@utils/constants";
import { classes } from "@utils/misc";
@ -114,7 +114,7 @@ export default definePlugin({
if (await DataStore.keys(HolyNoteStore).then(keys => !keys.includes("Main"))) return noteHandler.newNoteBook("Main");
if (!noteHandlerCache.has("Main")) await DataStoreToCache();
addButton("HolyNotes", message => {
addMessagePopoverButton("HolyNotes", message => {
return {
label: "Save Note",
icon: NoteButtonPopover,
@ -127,6 +127,6 @@ export default definePlugin({
},
async stop() {
removeButton("HolyNotes");
removeMessagePopoverButton("HolyNotes");
}
});

View file

@ -18,7 +18,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { addButton, removeButton } from "@api/MessagePopover";
import { addMessagePopoverButton, removeMessagePopoverButton } from "@api/MessagePopover";
import { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants";
import { classes } from "@utils/misc";
@ -103,7 +103,7 @@ export default definePlugin({
return id !== "" ? id : this.settings.store.emojiID;
},
async start() {
addButton("Husk", msg => {
addMessagePopoverButton("Husk", msg => {
return {
label: "Husk",
icon: Husk,
@ -121,7 +121,7 @@ export default definePlugin({
},
stop() {
removeButton("Husk");
removeMessagePopoverButton("Husk");
},
});

View file

@ -7,7 +7,7 @@
import "styles.css?managed";
import { DataStore } from "@api/index";
import { addPreSendListener, removePreSendListener } from "@api/MessageEvents";
import { addMessagePreSendListener, removeMessagePreSendListener } from "@api/MessageEvents";
import { Heart } from "@components/Heart";
import { EquicordDevs } from "@utils/constants";
import { openUserProfile } from "@utils/discord";
@ -364,7 +364,7 @@ export default definePlugin({
await data.initializeUsersCollection();
data.writeGuildsOwnersToCollection();
data.writeMembersFromUserGuildsToCollection();
data._onMessagePreSend_preSend = addPreSendListener(
data._onMessagePreSend_preSend = addMessagePreSendListener(
data.onMessagePreSend.bind(data)
);
data.storageAutoSaveProtocol();
@ -385,7 +385,7 @@ export default definePlugin({
stop() {
const dataManager = this.dataManager as Data;
removePreSendListener(dataManager._onMessagePreSend_preSend);
removeMessagePreSendListener(dataManager._onMessagePreSend_preSend);
clearInterval(dataManager._storageAutoSaveProtocol_interval);
},
});

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { addPreSendListener, removePreSendListener } from "@api/MessageEvents";
import { addMessagePreSendListener, removeMessagePreSendListener } from "@api/MessageEvents";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
export default definePlugin({
@ -13,12 +13,12 @@ export default definePlugin({
authors: [Devs.Samwich],
dependencies: ["MessageEventsAPI"],
start() {
this.preSend = addPreSendListener((channelId, msg) => {
this.preSend = addMessagePreSendListener((channelId, msg) => {
msg.content = textProcessing(msg.content);
});
},
stop() {
this.preSend = removePreSendListener((channelId, msg) => {
this.preSend = removeMessagePreSendListener((channelId, msg) => {
msg.content = textProcessing(msg.content);
});
},

View file

@ -5,8 +5,8 @@
*/
import {
addPreSendListener,
removePreSendListener,
addMessagePreSendListener,
removeMessagePreSendListener,
SendListener,
} from "@api/MessageEvents";
import {
@ -38,10 +38,10 @@ export default definePlugin({
authors: [Devs.Samwich],
dependencies: ["MessageEventsAPI"],
start() {
addPreSendListener(presendObject);
addMessagePreSendListener(presendObject);
},
stop() {
removePreSendListener(presendObject);
removeMessagePreSendListener(presendObject);
},
settings,
});

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { addPreSendListener, removePreSendListener } from "@api/MessageEvents";
import { addMessagePreSendListener, removeMessagePreSendListener } from "@api/MessageEvents";
import { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
@ -36,12 +36,12 @@ export default definePlugin({
settings,
start() {
this.preSend = addPreSendListener((_, msg) => {
this.preSend = addMessagePreSendListener((_, msg) => {
msg.content = replaceQuestionMarks(msg.content);
});
},
stop() {
removePreSendListener(this.preSend);
removeMessagePreSendListener(this.preSend);
}
});

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { addPreSendListener, MessageExtra, MessageObject, removePreSendListener } from "@api/MessageEvents";
import { addMessagePreSendListener, MessageExtra, MessageObject, removeMessagePreSendListener } from "@api/MessageEvents";
import { EquicordDevs } from "@utils/constants";
import definePlugin from "@utils/types";
@ -14,6 +14,6 @@ export default definePlugin({
name: "RemixMe",
description: "Turns every single message with attachment to have remix tag",
authors: [EquicordDevs.kvba],
start: () => addPreSendListener(handleMessage),
stop: () => removePreSendListener(handleMessage)
start: () => addMessagePreSendListener(handleMessage),
stop: () => removeMessagePreSendListener(handleMessage)
});

View file

@ -17,7 +17,7 @@
*/
import { findGroupChildrenByChildId, NavContextMenuPatchCallback } from "@api/ContextMenu";
import { addButton, removeButton } from "@api/MessagePopover";
import { addMessagePopoverButton, removeMessagePopoverButton } from "@api/MessagePopover";
import { classNameFactory } from "@api/Styles";
import { EquicordDevs } from "@utils/constants";
import { sendMessage } from "@utils/discord";
@ -103,7 +103,7 @@ export default definePlugin({
"message": messageCtxPatch
},
start() {
addButton("vc-repeat", message => {
addMessagePopoverButton("vc-repeat", message => {
if (!message.content && message.stickerItems.length === 0) return null;
return {
@ -119,7 +119,7 @@ export default definePlugin({
document.addEventListener("keydown", keydownListener);
},
stop() {
removeButton("vc-repeat");
removeMessagePopoverButton("vc-repeat");
document.removeEventListener("keyup", keyupListener);
document.removeEventListener("keydown", keydownListener);

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { addPreSendListener, removePreSendListener, SendListener } from "@api/MessageEvents";
import { addMessagePreSendListener, removeMessagePreSendListener, SendListener } from "@api/MessageEvents";
import { definePluginSettings, Settings } from "@api/Settings";
import { EquicordDevs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
@ -32,9 +32,9 @@ export default definePlugin({
}
}),
start() {
addPreSendListener(presendObject);
addMessagePreSendListener(presendObject);
},
stop() {
removePreSendListener(presendObject);
removeMessagePreSendListener(presendObject);
}
});

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { addDecoration, removeDecoration } from "@api/MessageDecorations";
import { addMessageDecoration, removeMessageDecoration } from "@api/MessageDecorations";
import { Devs, EquicordDevs } from "@utils/constants";
import { isEquicordPluginDev, isPluginDev } from "@utils/misc";
import definePlugin from "@utils/types";
@ -145,9 +145,9 @@ export default definePlugin({
dependencies: ["MessageDecorationsAPI"],
settings,
start: () => {
addDecoration("vc-show-badges-in-chat", props => props.message?.author ? <ChatBadges author={props.message.author} /> : null);
addMessageDecoration("vc-show-badges-in-chat", props => props.message?.author ? <ChatBadges author={props.message.author} /> : null);
},
stop: () => {
removeDecoration("vc-show-badges-in-chat");
removeMessageDecoration("vc-show-badges-in-chat");
}
});

View file

@ -7,7 +7,7 @@
import { addChatBarButton, ChatBarButton, removeChatBarButton } from "@api/ChatButtons";
import { ApplicationCommandInputType, ApplicationCommandOptionType, findOption, sendBotMessage } from "@api/Commands";
import { findGroupChildrenByChildId, NavContextMenuPatchCallback } from "@api/ContextMenu";
import { addPreSendListener, removePreSendListener } from "@api/MessageEvents";
import { addMessagePreSendListener, removeMessagePreSendListener } from "@api/MessageEvents";
import { definePluginSettings, migratePluginSettings } from "@api/Settings";
import { EquicordDevs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
@ -104,12 +104,12 @@ export default definePlugin({
start: () => {
if (settings.store.isEnabled) true;
addChatBarButton("Signature", SignatureToggle);
addPreSendListener(handleMessage);
addMessagePreSendListener(handleMessage);
},
stop: () => {
if (settings.store.isEnabled) false;
removeChatBarButton("Signature");
removePreSendListener(handleMessage);
removeMessagePreSendListener(handleMessage);
},

View file

@ -17,7 +17,7 @@
*/
import { addChatBarButton, ChatBarButton, removeChatBarButton } from "@api/ChatButtons";
import { addPreSendListener, removePreSendListener, SendListener } from "@api/MessageEvents";
import { addMessagePreSendListener, removeMessagePreSendListener, SendListener } from "@api/MessageEvents";
import { EquicordDevs } from "@utils/constants";
import definePlugin from "@utils/types";
import { React, useEffect, useState } from "@webpack/common";
@ -38,8 +38,8 @@ const ReverseMessageToggle: ChatBarButton = ({ isMainChat }) => {
if (enabled && message.content) message.content = message.content.split("").reverse().join("");
};
addPreSendListener(listener);
return () => void removePreSendListener(listener);
addMessagePreSendListener(listener);
return () => void removeMessagePreSendListener(listener);
}, [enabled]);
if (!isMainChat) return null;

View file

@ -19,8 +19,8 @@
import "./style.css";
import { findGroupChildrenByChildId, NavContextMenuPatchCallback } from "@api/ContextMenu";
import { addAccessory, removeAccessory } from "@api/MessageAccessories";
import { addButton, removeButton } from "@api/MessagePopover";
import { addMessageAccessory, removeMessageAccessory } from "@api/MessageAccessories";
import { addMessagePopoverButton, removeMessagePopoverButton } from "@api/MessagePopover";
import { Devs, EquicordDevs } from "@utils/constants";
import definePlugin from "@utils/types";
import { ChannelStore, Menu } from "@webpack/common";
@ -56,9 +56,9 @@ export default definePlugin({
},
start() {
addAccessory("ec-translation", props => <Accessory message={props.message} />);
addMessageAccessory("ec-translation", props => <Accessory message={props.message} />);
addButton("ec-translate", message => {
addMessagePopoverButton("ec-translate", message => {
if (!message.content) return null;
return {
@ -71,7 +71,7 @@ export default definePlugin({
});
},
stop() {
removeButton("ec-translate");
removeAccessory("ec-translation");
removeMessagePopoverButton("ec-translate");
removeMessageAccessory("ec-translation");
}
});

View file

@ -18,8 +18,8 @@
import "./style.css";
import { addAccessory } from "@api/MessageAccessories";
import { addButton } from "@api/MessagePopover";
import { addMessageAccessory } from "@api/MessageAccessories";
import { addMessagePopoverButton } from "@api/MessagePopover";
import { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
@ -57,8 +57,8 @@ export default definePlugin({
description: "Converts metric units to Imperal units and vice versa",
authors: [Devs.sadan],
start() {
addAccessory("vc-converter", props => <ConverterAccessory message={props.message} />);
addButton("vc-converter", message => {
addMessageAccessory("vc-converter", props => <ConverterAccessory message={props.message} />);
addMessagePopoverButton("vc-converter", message => {
if (!message.content) return null;
return {
label: "Convert Units",

View file

@ -17,7 +17,7 @@
*/
import { findOption, RequiredMessageOption } from "@api/Commands";
import { addPreEditListener, addPreSendListener, MessageObject, removePreEditListener, removePreSendListener } from "@api/MessageEvents";
import { addMessagePreEditListener, addMessagePreSendListener, MessageObject, removeMessagePreEditListener, removeMessagePreSendListener } from "@api/MessageEvents";
import { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
@ -199,14 +199,14 @@ export default definePlugin({
},
start() {
this.preSend = addPreSendListener((_, msg) => this.onSend(msg));
this.preEdit = addPreEditListener((_cid, _mid, msg) =>
this.preSend = addMessagePreSendListener((_, msg) => this.onSend(msg));
this.preEdit = addMessagePreEditListener((_cid, _mid, msg) =>
this.onSend(msg)
);
},
stop() {
removePreSendListener(this.preSend);
removePreEditListener(this.preEdit);
removeMessagePreSendListener(this.preSend);
removeMessagePreEditListener(this.preEdit);
},
});

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { addPreSendListener, removePreSendListener, SendListener } from "@api/MessageEvents";
import { addMessagePreSendListener, removeMessagePreSendListener, SendListener } from "@api/MessageEvents";
import { definePluginSettings } from "@api/Settings";
import { Devs, EquicordDevs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
@ -39,9 +39,9 @@ export default definePlugin({
settings,
start() {
addPreSendListener(presendObject);
addMessagePreSendListener(presendObject);
},
stop() {
removePreSendListener(presendObject);
removeMessagePreSendListener(presendObject);
}
});