diff --git a/package.json b/package.json index e649e0326..15f164078 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "equicord", "private": "true", - "version": "1.12.9", + "version": "1.12.10", "description": "The other cutest Discord client mod", "homepage": "https://github.com/Equicord/Equicord#readme", "bugs": { @@ -115,4 +115,4 @@ "engines": { "node": ">=18" } -} \ No newline at end of file +} diff --git a/src/api/MessageEvents.ts b/src/api/MessageEvents.ts index 94fb5c4d3..b08cb114e 100644 --- a/src/api/MessageEvents.ts +++ b/src/api/MessageEvents.ts @@ -66,7 +66,7 @@ export interface MessageReplyOptions { }; } -export interface MessageExtra { +export interface MessageOptions { stickers?: string[]; uploads?: Upload[]; replyOptions: MessageReplyOptions; @@ -76,17 +76,17 @@ export interface MessageExtra { openWarningPopout: (props: any) => any; } -export type MessageSendListener = (channelId: string, messageObj: MessageObject, extra: MessageExtra) => Promisable; +export type MessageSendListener = (channelId: string, messageObj: MessageObject, options: MessageOptions) => Promisable; export type MessageEditListener = (channelId: string, messageId: string, messageObj: MessageObject) => Promisable; const sendListeners = new Set(); const editListeners = new Set(); -export async function _handlePreSend(channelId: string, messageObj: MessageObject, extra: MessageExtra, replyOptions: MessageReplyOptions) { - extra.replyOptions = replyOptions; +export async function _handlePreSend(channelId: string, messageObj: MessageObject, options: MessageOptions, replyOptions: MessageReplyOptions) { + options.replyOptions = replyOptions; for (const listener of sendListeners) { try { - const result = await listener(channelId, messageObj, extra); + const result = await listener(channelId, messageObj, options); if (result?.cancel) { return true; } diff --git a/src/equicordplugins/musicControls/index.tsx b/src/equicordplugins/musicControls/index.tsx index 09c299c44..db1801eb2 100644 --- a/src/equicordplugins/musicControls/index.tsx +++ b/src/equicordplugins/musicControls/index.tsx @@ -35,6 +35,23 @@ export default definePlugin({ description: "Music Controls and Lyrics for multiple services ", authors: [Devs.Ven, Devs.afn, Devs.KraXen72, Devs.Av32000, Devs.nin0dev, EquicordDevs.thororen, EquicordDevs.vmohammad, Devs.Joona], settings, + tags: [ + // Spotify + "Spotify", + "SpotifyControls", + "SpotifyLyrics", + // Tidal + "Tidal", + "TidalControls", + "TidalLyrics", + // Youtube + /* Deprecated RN + "Youtube", + "YoutubeMusic", + "YoutubeMusicControls" + */ + ], + patches: [ { find: "this.isCopiedStreakGodlike", @@ -102,7 +119,15 @@ export default definePlugin({ }, async start() { + if (Settings.plugins?.SpotifyControls?.enabled) { + settings.store.showSpotifyControls = true; + Settings.plugins.SpotifyControls.enabled = false; + } + if (Settings.plugins?.SpotifyLyrics?.enabled) { + settings.store.showSpotifyLyrics = true; + Settings.plugins.SpotifyLyrics.enabled = false; + } await migrateOldLyrics(); - toggleHoverControls(Settings.plugins.MusicControls.hoverControls); + toggleHoverControls(settings.store.hoverControls); }, }); diff --git a/src/equicordplugins/musicControls/settings.tsx b/src/equicordplugins/musicControls/settings.tsx index 5d62d84f3..8e9c4eac0 100644 --- a/src/equicordplugins/musicControls/settings.tsx +++ b/src/equicordplugins/musicControls/settings.tsx @@ -6,13 +6,11 @@ import { definePluginSettings } from "@api/Settings"; import { disableStyle, enableStyle } from "@api/Styles"; -import { useAwaiter } from "@utils/react"; import { makeRange, OptionType } from "@utils/types"; -import { Button, Forms, MaskedLink, showToast, Text, Toasts, useMemo } from "@webpack/common"; +import { Button, Forms, MaskedLink, showToast, Toasts } from "@webpack/common"; import hoverOnlyStyle from "./hoverOnly.css?managed"; -import { clearLyricsCache, getLyricsCount } from "./spotify/lyrics/api"; -import { useLyrics } from "./spotify/lyrics/components/util"; +import { clearLyricsCache } from "./spotify/lyrics/api"; import { Provider } from "./spotify/lyrics/providers/types"; const sliderOptions = { @@ -24,26 +22,6 @@ export function toggleHoverControls(value: boolean) { (value ? enableStyle : disableStyle)(hoverOnlyStyle); } -function Details() { - const { lyricsInfo } = useLyrics(); - - const [count, error, loading] = useAwaiter( - useMemo(() => getLyricsCount, []), - { - onError: () => console.error("Failed to get lyrics count"), - fallbackValue: null, - } - ); - - return ( - <> - Current lyrics provider: {lyricsInfo?.useLyric || "None"} - {loading ? Loading lyrics count... : error ? Failed to get lyrics count : Lyrics count: {count}} - - ); -} - - function InstallInstructions() { return ( diff --git a/src/utils/discord.tsx b/src/utils/discord.tsx index d7a38ebb0..f236943b1 100644 --- a/src/utils/discord.tsx +++ b/src/utils/discord.tsx @@ -110,7 +110,7 @@ export function insertTextIntoChatInputBox(text: string) { }); } -interface MessageExtra { +interface MessageOptions { messageReference: Message["messageReference"]; allowedMentions: { parse: string[]; @@ -122,8 +122,8 @@ interface MessageExtra { export function sendMessage( channelId: string, data: Partial, - waitForChannelReady?: boolean, - extra?: Partial + waitForChannelReady = true, + options: Partial = {} ) { const messageData = { content: "", @@ -133,7 +133,7 @@ export function sendMessage( ...data }; - return MessageActions.sendMessage(channelId, messageData, waitForChannelReady, extra); + return MessageActions.sendMessage(channelId, messageData, waitForChannelReady, options); } /**