FakeNitro: Fix attempting to bypass unicode emojis

Closes #2470
main
Nuckyz 6 months ago
parent ffe1d7cc4d
commit 6547cc10f7
No known key found for this signature in database
GPG Key ID: 440BF8296E1C4AD9

@ -25,7 +25,7 @@ import { Logger } from "@utils/Logger";
import definePlugin, { OptionType } from "@utils/types";
import { findByPropsLazy, findStoreLazy, proxyLazyWebpack } from "@webpack";
import { Alerts, ChannelStore, DraftType, EmojiStore, FluxDispatcher, Forms, IconUtils, lodash, Parser, PermissionsBits, PermissionStore, UploadHandler, UserSettingsActionCreators, UserStore } from "@webpack/common";
import type { CustomEmoji } from "@webpack/types";
import type { Emoji } from "@webpack/types";
import type { Message } from "discord-types/general";
import { applyPalette, GIFEncoder, quantize } from "gifenc";
import type { ReactElement, ReactNode } from "react";
@ -812,8 +812,8 @@ export default definePlugin({
UploadHandler.promptToUpload([file], ChannelStore.getChannel(channelId), DraftType.ChannelMessage);
},
canUseEmote(e: CustomEmoji, channelId: string) {
if (e.require_colons === false) return true;
canUseEmote(e: Emoji, channelId: string) {
if (e.type === "UNICODE") return true;
if (e.available === false) return false;
const isUnusableRoleSubEmoji = RoleSubscriptionEmojiUtils.isUnusableRoleSubscriptionEmojiOriginal ?? RoleSubscriptionEmojiUtils.isUnusableRoleSubscriptionEmoji;

@ -63,7 +63,7 @@ export interface CustomEmoji {
originalName?: string;
require_colons: boolean;
roles: string[];
url: string;
type: "GUILD_EMOJI";
}
export interface UnicodeEmoji {
@ -75,6 +75,7 @@ export interface UnicodeEmoji {
};
index: number;
surrogates: string;
type: "UNICODE";
uniqueName: string;
useSpriteSheet: boolean;
get allNamesString(): string;

Loading…
Cancel
Save