More Fixes
Some checks are pending
Sync to Codeberg / Sync Codeberg and Github (push) Waiting to run
Test / Test (push) Waiting to run

This commit is contained in:
thororen1234 2025-01-22 22:51:34 -05:00
parent a676c20cc8
commit 149fc67090
9 changed files with 21 additions and 21 deletions

View file

@ -4,14 +4,14 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { addChatBarButton, ChatBarButton, removeChatBarButton } from "@api/ChatButtons";
import { addChatBarButton, ChatBarButton, ChatBarButtonFactory, removeChatBarButton } from "@api/ChatButtons";
import {
ApplicationCommandInputType,
ApplicationCommandOptionType,
sendBotMessage,
} from "@api/Commands";
import * as DataStore from "@api/DataStore";
import { addMessagePreSendListener, removeMessagePreSendListener, SendListener } from "@api/MessageEvents";
import { addMessagePreSendListener, MessageSendListener, removeMessagePreSendListener } from "@api/MessageEvents";
import { Devs } from "@utils/constants";
import { sleep } from "@utils/misc";
import definePlugin from "@utils/types";
@ -41,12 +41,12 @@ interface IMessageCreate {
message: Message;
}
const ChatBarIcon: ChatBarButton = ({ isMainChat }) => {
const ChatBarIcon: ChatBarButtonFactory = ({ isMainChat }) => {
[enabled, setEnabled] = useState(false);
const [buttonDisabled, setButtonDisabled] = useState(false);
useEffect(() => {
const listener: SendListener = async (_, message) => {
const listener: MessageSendListener = async (_, message) => {
if (enabled) {
const groupChannel = await DataStore.get("encryptcordChannelId");
// @ts-expect-error typing issue

View file

@ -4,10 +4,10 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { addChatBarButton, ChatBarButton, removeChatBarButton } from "@api/ChatButtons";
import { addChatBarButton, ChatBarButton, ChatBarButtonFactory, removeChatBarButton } from "@api/ChatButtons";
import { ApplicationCommandInputType, ApplicationCommandOptionType, findOption, sendBotMessage } from "@api/Commands";
import { findGroupChildrenByChildId, NavContextMenuPatchCallback } from "@api/ContextMenu";
import { addMessagePreSendListener, removeMessagePreSendListener, SendListener } from "@api/MessageEvents";
import { addMessagePreSendListener, MessageSendListener, removeMessagePreSendListener } from "@api/MessageEvents";
import { definePluginSettings, Settings } from "@api/Settings";
import { ErrorCard } from "@components/ErrorCard";
import { Link } from "@components/Link";
@ -103,7 +103,7 @@ function messageSendListenerFuncs() {
}
const FurudoSpeakChatToggle: ChatBarButton = ({ isMainChat }) => {
const FurudoSpeakChatToggle: ChatBarButtonFactory = ({ isMainChat }) => {
const { isEnabled, showIcon } = furudosettings.use(["isEnabled", "showIcon"]);
const toggle = async () => {
const done = await togglefunc();
@ -160,7 +160,7 @@ const ChatBarContextCheckbox: NavContextMenuPatchCallback = children => {
};
const presendObject: SendListener = async (channelId, msg, extra) => {
const presendObject: MessageSendListener = async (channelId, msg, extra) => {
const messageRef = extra.replyOptions.messageReference;
const repliedMessage = ((messageRef?.message_id && messageRef.channel_id) && MessageStore.getMessage(messageRef?.channel_id, messageRef?.message_id)) || undefined;
const apikey = Settings.plugins.FurudoSpeak.apiKey || "";

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { addChatBarButton, ChatBarButton, removeChatBarButton } from "@api/ChatButtons";
import { addChatBarButton, ChatBarButton, ChatBarButtonFactory, removeChatBarButton } from "@api/ChatButtons";
import { Devs } from "@utils/constants";
import { getCurrentChannel, sendMessage } from "@utils/discord";
import definePlugin from "@utils/types";
@ -14,7 +14,7 @@ async function handleButtonClick() {
sendMessage(getCurrentChannel().id, { content: "meow" });
}
const ChatBarIcon: ChatBarButton = () => {
const ChatBarIcon: ChatBarButtonFactory = () => {
return (
<ChatBarButton tooltip="Meow" onClick={handleButtonClick}>
<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 576 512"><path fill="currentColor" d="M320 192h17.1c22.1 38.3 63.5 64 110.9 64c11 0 21.8-1.4 32-4v228c0 17.7-14.3 32-32 32s-32-14.3-32-32V339.2L280 448h56c17.7 0 32 14.3 32 32s-14.3 32-32 32H192c-53 0-96-43-96-96V192.5c0-16.1-12-29.8-28-31.8l-7.9-1c-17.5-2.2-30-18.2-27.8-35.7S50.5 94 68 96.2l7.9 1c48 6 84.1 46.8 84.1 95.3v85.3c34.4-51.7 93.2-85.8 160-85.8m160 26.5c-10 3.5-20.8 5.5-32 5.5c-28.4 0-54-12.4-71.6-32c-3.7-4.1-7-8.5-9.9-13.2C357.3 164 352 146.6 352 128V10.7C352 4.8 356.7.1 362.6 0h.2c3.3 0 6.4 1.6 8.4 4.2v.1l12.8 17l27.2 36.3L416 64h64l4.8-6.4L512 21.3l12.8-17v-.1c2-2.6 5.1-4.2 8.4-4.2h.2c5.9.1 10.6 4.8 10.6 10.7V128c0 17.3-4.6 33.6-12.6 47.6c-11.3 19.8-29.6 35.2-51.4 42.9M432 128a16 16 0 1 0-32 0a16 16 0 1 0 32 0m48 16a16 16 0 1 0 0-32a16 16 0 1 0 0 32" /></svg>

View file

@ -6,8 +6,8 @@
import {
addMessagePreSendListener,
MessageSendListener,
removeMessagePreSendListener,
SendListener,
} from "@api/MessageEvents";
import {
definePluginSettings,
@ -17,7 +17,7 @@ import {
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
const presendObject: SendListener = (channelId, msg) => {
const presendObject: MessageSendListener = (channelId, msg) => {
msg.content = textProcessing(msg.content);
};

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { addChatBarButton, ChatBarButton, removeChatBarButton } from "@api/ChatButtons";
import { addChatBarButton, ChatBarButton, ChatBarButtonFactory, removeChatBarButton } from "@api/ChatButtons";
import { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants";
import { openModal } from "@utils/modal";
@ -21,7 +21,7 @@ const settings = definePluginSettings({
}
});
const SekaiStickerChatButton: ChatBarButton = () => {
const SekaiStickerChatButton: ChatBarButtonFactory = () => {
return (
<ChatBarButton onClick={() => openModal(props => <SekaiStickersModal modalProps={props} settings={settings} />)} tooltip="Sekai Stickers">
{kanadeSvg()}

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, Settings } from "@api/Settings";
import { EquicordDevs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
@ -12,7 +12,7 @@ import { MessageStore } from "@webpack/common";
import { transferMessage } from "./native";
const presendObject: SendListener = async (channelId, msg, extra) => {
const presendObject: MessageSendListener = async (channelId, msg, extra) => {
const messageRef = extra.replyOptions.messageReference;
const repliedMessage = ((messageRef?.message_id && messageRef.channel_id) && MessageStore.getMessage(messageRef?.channel_id, messageRef?.message_id)) || undefined;
msg.content = await transferMessage(msg, Settings.plugins.Shakespearean.model, repliedMessage);

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { addChatBarButton, ChatBarButton, removeChatBarButton } from "@api/ChatButtons";
import { addChatBarButton, ChatBarButton, ChatBarButtonFactory, removeChatBarButton } from "@api/ChatButtons";
import { ApplicationCommandInputType, ApplicationCommandOptionType, findOption, sendBotMessage } from "@api/Commands";
import { findGroupChildrenByChildId, NavContextMenuPatchCallback } from "@api/ContextMenu";
import { addMessagePreSendListener, removeMessagePreSendListener } from "@api/MessageEvents";
@ -40,7 +40,7 @@ const settings = definePluginSettings(
},
});
const SignatureToggle: ChatBarButton = ({ isMainChat }) => {
const SignatureToggle: ChatBarButtonFactory = ({ isMainChat }) => {
const { isEnabled, showIcon } = settings.use(["isEnabled", "showIcon"]);
const toggle = () => settings.store.isEnabled = !settings.store.isEnabled;

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { addChatBarButton, ChatBarButton, removeChatBarButton } from "@api/ChatButtons";
import { addChatBarButton, ChatBarButton, ChatBarButtonFactory, removeChatBarButton } from "@api/ChatButtons";
import { Devs } from "@utils/constants";
import { getCurrentChannel, sendMessage } from "@utils/discord";
import definePlugin from "@utils/types";
@ -14,7 +14,7 @@ async function handleButtonClick() {
sendMessage(getCurrentChannel().id, { content: "woof" });
}
const ChatBarIcon: ChatBarButton = () => {
const ChatBarIcon: ChatBarButtonFactory = () => {
return (
<ChatBarButton tooltip="Woof" onClick={handleButtonClick}>
<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 576 512"><path fill="currentColor" d="m309.6 158.5l23.1-138.7C334.6 8.4 344.5 0 356.1 0c7.5 0 14.5 3.5 19 9.5L392 32h52.1c12.7 0 24.9 5.1 33.9 14.1L496 64h56c13.3 0 24 10.7 24 24v24c0 44.2-35.8 80-80 80h-69.3l-5.1 30.5zM416 256.1V480c0 17.7-14.3 32-32 32h-32c-17.7 0-32-14.3-32-32V364.8c-24 12.3-51.2 19.2-80 19.2s-56-6.9-80-19.2V480c0 17.7-14.3 32-32 32H96c-17.7 0-32-14.3-32-32V249.8c-28.8-10.9-51.4-35.3-59.2-66.5L1 167.8c-4.3-17.1 6.1-34.5 23.3-38.8s34.5 6.1 38.8 23.3l3.9 15.5C70.5 182 83.3 192 98 192h205.8zM464 80a16 16 0 1 0-32 0a16 16 0 1 0 32 0" /></svg>

View file

@ -203,7 +203,7 @@ export type SettingsChecks<D extends SettingsDefinition> = {
(IsDisabled<DefinedSettings<D>> & IsValid<PluginSettingType<D[K]>, DefinedSettings<D>>);
};
export type PluginSettingDef = (PluginSettingCustomDef & Pick<PluginSettingCommon, "onChange">) | ((
export type PluginSettingDef = (PluginSettingCommon & PluginSettingCustomDef & Pick<PluginSettingCommon, "onChange">) | ((
| PluginSettingStringDef
| PluginSettingNumberDef
| PluginSettingBooleanDef