From 281e9caeff0ae7a332844fab2a3cd15001e76cbc Mon Sep 17 00:00:00 2001 From: Eazvy <57739965+Eazvy@users.noreply.github.com> Date: Sun, 4 May 2025 23:40:40 -0400 Subject: [PATCH] add (autoJump) (#245) * Create index.tsx * Update index.tsx * Create index.tsx * Update index.tsx * Update index.tsx * Create index.tsx * Delete index.tsx * Delete index.tsx * Create index.tsx * update plugin-settings / main settings yep * Delete index.tsx * Revert * Add AutoJump * Only Trigger Flux On Setting * Remove Extra Auto * Misc Fix --------- Co-authored-by: thororen1234 <78185467+thororen1234@users.noreply.github.com> --- src/components/PluginSettings/styles.css | 8 +-- src/equicordplugins/autoJump/index.tsx | 69 +++++++++++++++++++++ src/equicordplugins/purgeMessages/index.tsx | 5 +- 3 files changed, 74 insertions(+), 8 deletions(-) create mode 100644 src/equicordplugins/autoJump/index.tsx diff --git a/src/components/PluginSettings/styles.css b/src/components/PluginSettings/styles.css index ce131729..488fd212 100644 --- a/src/components/PluginSettings/styles.css +++ b/src/components/PluginSettings/styles.css @@ -252,7 +252,7 @@ } .visual-refresh .button-danger-background:hover { - background-color: var(--status-danger-background) !important; + background-color: var(--status-danger-background) !important; color: var(--status-danger-text) !important; } @@ -261,15 +261,15 @@ border: 1px solid var(--border-subtle) !important; &:hover { - background-color: var(--card-primary-bg) !important; + background-color: var(--card-primary-bg) !important; } - } +} .visual-refresh .vc-plugin-stats { background-color: var(--card-primary-bg) !important; border: 1px solid var(--border-subtle) !important; &:hover { - background-color: var(--card-primary-bg) !important; + background-color: var(--card-primary-bg) !important; } } diff --git a/src/equicordplugins/autoJump/index.tsx b/src/equicordplugins/autoJump/index.tsx new file mode 100644 index 00000000..b05ba1e6 --- /dev/null +++ b/src/equicordplugins/autoJump/index.tsx @@ -0,0 +1,69 @@ +/* + * Vencord, a Discord client mod + * Copyright (c) 2024 Vendicated and contributors + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +import { NavContextMenuPatchCallback } from "@api/ContextMenu"; +import { definePluginSettings } from "@api/Settings"; +import { EquicordDevs } from "@utils/constants"; +import definePlugin, { OptionType } from "@utils/types"; +import { ChannelStore, Menu, MessageActions, NavigationRouter } from "@webpack/common"; + +interface ChannelSelectEvent { + type: "CHANNEL_SELECT"; + channelId: string | null; + guildId: string | null; +} + +let lastChannelId = "0"; + +function autoJump({ guild_id, id: channelId }) { + const guildId = guild_id ?? "@me"; + + lastChannelId = channelId; + NavigationRouter.transitionTo(`/channels/${guildId}/${channelId}`); + MessageActions.jumpToPresent(channelId, { limit: null }); +} + +const MenuPatch: NavContextMenuPatchCallback = (children, { channel }) => { + children.push( +