diff --git a/lib/init/src/index.ts b/lib/init/src/index.ts index bc6e388..898c0f5 100644 --- a/lib/init/src/index.ts +++ b/lib/init/src/index.ts @@ -20,8 +20,12 @@ onModuleFirstRequired( onModuleInitialized( 0, runCatching(function onceIndexInitialized() { + // Register all plugins + require('@plugins/all') + // Initialize init libraries require('@revenge-mod/assets/init') + require('@revenge-mod/plugins/init') logger.log('Revenge loaded!') diff --git a/plugins/all.ts b/plugins/all.ts new file mode 100644 index 0000000..bb59fdb --- /dev/null +++ b/plugins/all.ts @@ -0,0 +1 @@ +import './staff-settings' diff --git a/plugins/staff-settings/index.ts b/plugins/staff-settings/index.ts new file mode 100644 index 0000000..d1f7160 --- /dev/null +++ b/plugins/staff-settings/index.ts @@ -0,0 +1,23 @@ +import { findModule } from '@revenge-mod/modules/finders' +import { byProps } from '@revenge-mod/modules/finders/filters' + +import { after } from '@revenge-mod/patcher' + +import { PluginFlags } from '@revenge-mod/plugins' +import { registerPlugin } from '@revenge-mod/plugins/_' + +registerPlugin( + { + id: 'revenge.staff-settings', + name: 'Staff Settings', + description: "Allows accessing Discord's Staff Settings.", + icon: 'StaffBadgeIcon', + }, + { + init: async ({ cleanup }) => { + const UserStoreUtils = await findModule(byProps('isStaffEnv')) + cleanup(after(UserStoreUtils, 'isStaffEnv', () => true)) + }, + }, + PluginFlags.Internal | PluginFlags.Enabled, +)