Plugin
NoServerEmojis
Do not show server emojis in the autocomplete menu.
1
/*2
* FiveCord — a Discord client mod3
* Copyright (c) 2025 FiveCord4
* SPDX-License-Identifier: GPL-3.0-or-later5
*/6
7
import { definePluginSettings } from "@api/Settings";8
import { Devs } from "@utils/constants";9
import definePlugin, { OptionType } from "@utils/types";10
import type { Channel, Emoji } from "@vencord/discord-types";11
12
const settings = definePluginSettings({13
shownEmojis: {14
description: "The types of emojis to show in the autocomplete menu.",15
type: OptionType.SELECT,16
default: "onlyUnicode",17
options: [18
{ label: "Only unicode emojis", value: "onlyUnicode" },19
{ label: "Unicode emojis and server emojis from current server", value: "currentServer" },20
{ label: "Unicode emojis and all server emojis (Discord default)", value: "all" }21
]22
}23
});24
25
export default definePlugin({26
name: "NoServerEmojis",27
authors: [Devs.UlyssesZhan],28
description: "Do not show server emojis in the autocomplete menu.",29
tags: ["Emotes", "Servers"],30
settings,31
32
patches: [33
{34
find: "}searchWithoutFetchingLatest(",35
replacement: {36
match: /\.nameMatchesChain\(\i\)\.reduce\(\((\i),(\i)\)=>\{(?<=channel:(\i).+?)/,37
replace: "$&if($self.shouldSkip($3,$2))return $1;"38
}39
}40
],41
42
shouldSkip(channel: Channel | undefined | null, emoji: Emoji) {43
if (emoji.type !== 1) {44
return false;45
}46
47
if (settings.store.shownEmojis === "onlyUnicode") {48
return true;49
}50
51
if (settings.store.shownEmojis === "currentServer") {52
return emoji.guildId !== (channel != null ? channel.getGuildId() : null);53
}54
55
return false;56
}57
});58