From c8d820cb1577c0ffeca8effcb34943e052cb7828 Mon Sep 17 00:00:00 2001 From: PalmDevs Date: Fri, 14 Aug 2026 01:50:09 +0700 Subject: [PATCH] chore(lib/discord): cleanup --- lib/discord/src/design.ts | 28 ++++++++++++---------------- lib/discord/src/flux/dispatcher.ts | 2 +- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/lib/discord/src/design.ts b/lib/discord/src/design.ts index 3c3a9d0..0508056 100644 --- a/lib/discord/src/design.ts +++ b/lib/discord/src/design.ts @@ -1,5 +1,5 @@ import { lookupModule, lookupModules } from '@revenge-mod/modules/finders' -import { withDependencies } from '@revenge-mod/modules/finders/filters' +import { withDependencies, withProps } from '@revenge-mod/modules/finders/filters' import { ReactJSXRuntimeModuleId, ReactModuleId, @@ -26,25 +26,21 @@ export let Design: Design = proxify( () => { // ID: 13171 // [3909, 4608, 5182, 13172, 2, ...] (141 dependencies) - const [, id] = lookupModule( + const [module] = lookupModule( + withProps('TableRow', 'Button').and( withDependencies( - atLeast(DesignMinimumDependencies, [ - [ImportTrackerModuleId], - [ImportTrackerModuleId], - [ReactNativeModuleId, ImportTrackerModuleId], - [ImportTrackerModuleId], - ImportTrackerModuleId, - ]), + atLeast(DesignMinimumDependencies, [ + [ImportTrackerModuleId], + [ImportTrackerModuleId], + [ReactNativeModuleId, ImportTrackerModuleId], + [ImportTrackerModuleId], + ImportTrackerModuleId, + ]), + ) ).keyAs('revenge.discord.design.Design'), - { - initialize: false, - }, ) - if (id === undefined) return - - const module = __r(id)! - if (module.TableRow && module.Button) return (Design = module) + if (module) return (Design = module) }, { hint: {}, diff --git a/lib/discord/src/flux/dispatcher.ts b/lib/discord/src/flux/dispatcher.ts index b840048..734dd7a 100644 --- a/lib/discord/src/flux/dispatcher.ts +++ b/lib/discord/src/flux/dispatcher.ts @@ -27,7 +27,7 @@ export function onAnyFluxEventDispatched(patch: FluxEventDispatchPatch) { * @param patch The patch function to apply when the event is dispatched. * @returns A function that can be used to remove the patch. * - * @example Blocking the disptach + * @example Blocking the dispatch * ```ts * // Returning falsy values will prevent the event from being dispatched. * onFluxEventDispatched('TYPING_START', () => {})