diff --git a/src/plugins/noServerEmojis/index.ts b/src/plugins/noServerEmojis/index.ts index ed843769c..6f4bb8a19 100644 --- a/src/plugins/noServerEmojis/index.ts +++ b/src/plugins/noServerEmojis/index.ts @@ -7,6 +7,7 @@ import { definePluginSettings } from "@api/Settings"; import { Devs } from "@utils/constants"; import definePlugin, { OptionType } from "@utils/types"; +import { type Emoji, EmojiType } from "@vencord/discord-types"; const settings = definePluginSettings({ shownEmojis: { @@ -35,8 +36,8 @@ export default definePlugin({ } } ], - shouldSkip(guildId: string, emoji: any) { - if (emoji.type !== "GUILD_EMOJI") { + shouldSkip(guildId: string, emoji: Emoji) { + if (emoji.type !== EmojiType.GUILD) { return false; } if (settings.store.shownEmojis === "onlyUnicode") { diff --git a/src/plugins/secretRingTone/index.ts b/src/plugins/secretRingTone/index.ts index be804efc4..f2913afd1 100644 --- a/src/plugins/secretRingTone/index.ts +++ b/src/plugins/secretRingTone/index.ts @@ -4,21 +4,38 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ +import { definePluginSettings } from "@api/Settings"; import { Devs } from "@utils/constants"; -import definePlugin from "@utils/types"; +import definePlugin, { OptionType } from "@utils/types"; + +const settings = definePluginSettings({ + onlySnow: { + type: OptionType.BOOLEAN, + description: "Only play the Snow Halation Theme", + default: false, + restartNeeded: true + } +}); -// NOTE - Ultimately should probably be turned into a ringtone picker plugin export default definePlugin({ name: "SecretRingToneEnabler", description: "Always play the secret version of the discord ringtone (except during special ringtone events)", - authors: [Devs.AndrewDLO, Devs.FieryFlames], + authors: [Devs.AndrewDLO, Devs.FieryFlames, Devs.RamziAH], + settings, patches: [ { find: '"call_ringing_beat"', - replacement: { - match: /500!==\i\(\)\.random\(1,1e3\)/, - replace: "false", - } - }, - ], + replacement: [ + { + match: /500!==\i\(\)\.random\(1,1e3\)/, + replace: "false" + }, + { + predicate: () => settings.store.onlySnow, + match: /"call_ringing_beat",/, + replace: "" + } + ] + } + ] }); diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 7fb2b6bf0..b0ad77fb1 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -566,6 +566,10 @@ export const Devs = /* #__PURE__*/ Object.freeze({ name: "niko", id: 341377368075796483n, }, + RamziAH: { + name: "RamziAH", + id: 1279957227612147747n, + }, } satisfies Record); // iife so #__PURE__ works correctly