Moar Fixes

This commit is contained in:
thororen1234 2025-01-23 12:53:42 -05:00
parent 149fc67090
commit 663c43e84f
7 changed files with 15 additions and 12 deletions

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { ChatBarButton } from "@api/ChatButtons";
import { ChatBarButton, ChatBarButtonFactory } from "@api/ChatButtons";
import { classes } from "@utils/misc";
import { Button, ButtonLooks, ButtonWrapperClasses, Tooltip } from "@webpack/common";
@ -58,7 +58,7 @@ export function IconWithTooltip({ text, icon, onClick }) {
</Tooltip>;
}
export const ChatBarIcon: ChatBarButton = () => {
export const ChatBarIcon: ChatBarButtonFactory = () => {
return (
<ChatBarButton tooltip="Open SoundBoard Log"
onClick={openSoundBoardLog}>

View file

@ -16,15 +16,15 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { addChatBarButton, ChatBarButton, removeChatBarButton } from "@api/ChatButtons";
import { addMessagePreSendListener, removeMessagePreSendListener, SendListener } from "@api/MessageEvents";
import { addChatBarButton, ChatBarButton, ChatBarButtonFactory, removeChatBarButton } from "@api/ChatButtons";
import { addMessagePreSendListener, MessageSendListener, removeMessagePreSendListener } from "@api/MessageEvents";
import { EquicordDevs } from "@utils/constants";
import definePlugin from "@utils/types";
import { React, useEffect, useState } from "@webpack/common";
let lastState = false;
const ReverseMessageToggle: ChatBarButton = ({ isMainChat }) => {
const ReverseMessageToggle: ChatBarButtonFactory = ({ isMainChat }) => {
const [enabled, setEnabled] = useState(lastState);
function setEnabledValue(value: boolean) {
@ -34,7 +34,7 @@ const ReverseMessageToggle: ChatBarButton = ({ isMainChat }) => {
}
useEffect(() => {
const listener: SendListener = async (_, message) => {
const listener: MessageSendListener = async (_, message) => {
if (enabled && message.content) message.content = message.content.split("").reverse().join("");
};

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { addMessagePreSendListener, removeMessagePreSendListener, SendListener } from "@api/MessageEvents";
import { addMessagePreSendListener, MessageSendListener, removeMessagePreSendListener } from "@api/MessageEvents";
import { definePluginSettings } from "@api/Settings";
import { Devs, EquicordDevs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
@ -19,7 +19,7 @@ const settings = definePluginSettings(
}
);
const presendObject: SendListener = (_, msg) => {
const presendObject: MessageSendListener = (_, msg) => {
const sentences = msg.content.split(/(?<=\w\.)\s/);
const blockedWordsArray: string[] = settings.store.blockedWords.split(", ");

View file

@ -171,7 +171,6 @@ const settings = definePluginSettings({
idsList: {
type: OptionType.COMPONENT,
description: "",
default: "",
onChange(newValue: string) {
const ids = new Set(newValue.split(",").map(id => id.trim()).filter(Boolean));
settings.store.idsList = Array.from(ids).join(", ");
@ -212,7 +211,8 @@ const settings = definePluginSettings({
ignoredActivities: {
type: OptionType.CUSTOM,
default: [] as IgnoredActivity[],
onChange: recalculateActivities
onChange: recalculateActivities,
description: "",
}
});

View file

@ -76,7 +76,6 @@ function createTagCommand(tag: Tag) {
const settings = definePluginSettings({
clyde: {
name: "Clyde message on send",
description: "If enabled, clyde will send you an ephemeral message when a tag was used.",
type: OptionType.BOOLEAN,
default: true
@ -84,6 +83,7 @@ const settings = definePluginSettings({
tagsList: {
type: OptionType.CUSTOM,
default: {} as Record<string, Tag>,
description: "",
}
});

View file

@ -59,7 +59,8 @@ export const settings = definePluginSettings({
},
userBasedCategoryList: {
type: OptionType.CUSTOM,
default: {} as Record<string, Category[]>
default: {} as Record<string, Category[]>,
description: "",
}
});

View file

@ -67,10 +67,12 @@ const settings = definePluginSettings({
stringRules: {
type: OptionType.CUSTOM,
default: makeEmptyRuleArray(),
description: "",
},
regexRules: {
type: OptionType.CUSTOM,
default: makeEmptyRuleArray(),
description: "",
}
});