From 4ed679ef15ec9c3f536bffd09cbc3f958639bde7 Mon Sep 17 00:00:00 2001 From: Eazvy <57739965+Eazvy@users.noreply.github.com> Date: Tue, 10 Feb 2026 12:39:15 -0500 Subject: [PATCH] waitForSlot (simple) (#749) * Add files via upload * Delete src/equicordplugins/waitForSlot/utils/voice.ts * waitForSlot better * fix audio url * Update notification audio URL for waitForSlot plugin --------- Co-authored-by: thororen1234 <78185467+thororen1234@users.noreply.github.com> --- src/equicordplugins/waitForSlot/index.tsx | 111 ++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 src/equicordplugins/waitForSlot/index.tsx diff --git a/src/equicordplugins/waitForSlot/index.tsx b/src/equicordplugins/waitForSlot/index.tsx new file mode 100644 index 000000000..a891b0f40 --- /dev/null +++ b/src/equicordplugins/waitForSlot/index.tsx @@ -0,0 +1,111 @@ +/* + * Vencord, a Discord client mod + * Copyright (c) 2026 Vendicated and contributors + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +import { playAudio } from "@api/AudioPlayer"; +import { NavContextMenuPatchCallback } from "@api/ContextMenu"; +import { popNotice, showNotice } from "@api/Notices"; +import { definePluginSettings } from "@api/Settings"; +import { Devs, EquicordDevs } from "@utils/constants"; +import definePlugin, { OptionType } from "@utils/types"; +import type { Channel } from "@vencord/discord-types"; +import { ChannelType } from "@vencord/discord-types/enums"; +import { ChannelActions, ChannelStore, Menu, VoiceStateStore } from "@webpack/common"; + +let waitingChannelId: string | null = null; + +const NOTIFICATION_AUDIO_URL = "https://raw.githubusercontent.com/Equicord/Equibored/main/sounds/waitForSlot/notification.mp3"; + +const settings = definePluginSettings({ + autoJoin: { + type: OptionType.BOOLEAN, + description: "Join the channel immediately instead of showing a notice.", + default: false, + }, + notificationSound: { + type: OptionType.BOOLEAN, + description: "Play a sound when a slot becomes available.", + default: true, + }, +}); + +const ChannelContext: NavContextMenuPatchCallback = (children, { channel }) => { + if (channel?.type !== ChannelType.GUILD_VOICE || !channel.userLimit) return; + if (Object.keys(VoiceStateStore.getVoiceStatesForChannel(channel.id)).length < channel.userLimit) return; + + const isWaiting = waitingChannelId === channel.id; + + children.splice(-1, 0, +