DiscordFreeEmojis icon indicating copy to clipboard operation
DiscordFreeEmojis copied to clipboard

Cannot send custom emojis in DMs

Open DaSunyxo opened this issue 1 year ago • 15 comments

In case you don't know where the bug is in the code or what exactly causes it.

Describe the bug When trying to send a custom emoji that was either typed in or picked from the emoji picker in DMs, Discord doesn't let you send the message at all and blacks out the "typing bar" (I don't know what it's called, but it's where you type messages), preventing you from sending messages at all until you open another DM or a server channel.

To Reproduce Simply try to DM someone a custom emoji.

Steps to reproduce the behavior:

  1. Go to your DMs
  2. Pick any conversation
  3. Type out/pick any custom emoji
  4. Try to send the message
  5. Message doesn't send and you cannot send any message

Make sure you can reproduce this problem yourself with your steps after restarting Discord!

Expected behavior Normally, you should be able to send the custom emoji without any issues.

Screenshots Before pressing enter: Screenshot 2024-06-11 124019 After pressing enter: Screenshot 2024-06-11 124255

Client:

  • Discord for PC (Windows 11)
  • Discord update channel: Release
  • Plugin V1.7
  • BD V1.10.1

Additional context Add any other context about the problem here.

DaSunyxo avatar Jun 11 '24 10:06 DaSunyxo

Yeah, noticed this happening for me too

Parad1se-py avatar Jun 11 '24 12:06 Parad1se-py

Same issue

JackAttacktl avatar Jul 24 '24 15:07 JackAttacktl

This happens on the official linux release client as well, has been for a few months now

KatTheGhost avatar Aug 07 '24 17:08 KatTheGhost

For me it has extended to all servers, not just DMS Please fix it, literally makes the plugin unusable

JackAttacktl avatar Aug 28 '24 01:08 JackAttacktl

Error code seems to be

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'split') at replaceEmoji (DiscordFreeEmojis64px.plugin.js:148:151) at Object.parseHook (DiscordFreeEmojis64px.plugin.js:156:17) at Init.messageEmojiParserModule.parse (DiscordFreeEmojis64px.plugin.js:122:68) at 2b9ba375e94bf3299698.js:1:157176

JackAttacktl avatar Aug 28 '24 01:08 JackAttacktl

It seems that "emoji" doesn't have a parameter "url", at least not anymore. Probably an update broke it and it hasn't been updated. I made a simple fix, I changed line 146 to

parseResult.content = parseResult.content.replace(`<${emoji.animated ? "a" : ""}:${emoji.originalName || emoji.name}:${emoji.id}>`, "https://cdn.discordapp.com/emojis/" + emoji.id + ".webp" + "?size=64");

JackAttacktl avatar Aug 28 '24 01:08 JackAttacktl

This happens on the official linux release client as well, has been for a few months now

Same for me on Linux Mint

realasib avatar Aug 30 '24 00:08 realasib

It seems that "emoji" doesn't have a parameter "url", at least not anymore. Probably an update broke it and it hasn't been updated. I made a simple fix, I changed line 146 to

parseResult.content = parseResult.content.replace(<${emoji.animated ? "a" : ""}:${emoji.originalName || emoji.name}:${emoji.id}>, "https://cdn.discordapp.com/emojis/" + emoji.id + ".webp" + "?size=64");

Thanks a lot,this is working for me.

realasib avatar Aug 30 '24 00:08 realasib

It seems that "emoji" doesn't have a parameter "url", at least not anymore. Probably an update broke it and it hasn't been updated. I made a simple fix, I changed line 146 to

parseResult.content = parseResult.content.replace(<${emoji.animated ? "a" : ""}:${emoji.originalName || emoji.name}:${emoji.id}>, "https://cdn.discordapp.com/emojis/" + emoji.id + ".webp" + "?size=64");

@JackAttacktl . This also worked for me, thank you so much. It only sends non-animated emoji's for me. the animated ones become pictures

SNOW-yz avatar Sep 19 '24 20:09 SNOW-yz

It seems that "emoji" doesn't have a parameter "url", at least not anymore. Probably an update broke it and it hasn't been updated. I made a simple fix, I changed line 146 to

parseResult.content = parseResult.content.replace(<${emoji.animated ? "a" : ""}:${emoji.originalName || emoji.name}:${emoji.id}>, "https://cdn.discordapp.com/emojis/" + emoji.id + ".webp" + "?size=64");

worked for me, thanks!

LeoneVi avatar Sep 22 '24 21:09 LeoneVi

It seems that "emoji" doesn't have a parameter "url", at least not anymore. Probably an update broke it and it hasn't been updated. I made a simple fix, I changed line 146 to

parseResult.content = parseResult.content.replace(<${emoji.animated ? "a" : ""}:${emoji.originalName || emoji.name}:${emoji.id}>, "https://cdn.discordapp.com/emojis/" + emoji.id + ".webp" + "?size=64");

Hey, this doesn't work for me, unfortunately. I copy and pasted the line at line 146 and it still doesn't work. Instead, it sends the emojis in plain text, so an emoji named "wtf" would simply appear as :wtf:

image

DaSunyxo avatar Oct 23 '24 20:10 DaSunyxo

It seems that "emoji" doesn't have a parameter "url", at least not anymore. Probably an update broke it and it hasn't been updated. I made a simple fix, I changed line 146 to parseResult.content = parseResult.content.replace(<${emoji.animated ? "a" : ""}:${emoji.originalName || emoji.name}:${emoji.id}>, "https://cdn.discordapp.com/emojis/" + emoji.id + ".webp" + "?size=64");

@JackAttacktl . This also worked for me, thank you so much. It only sends non-animated emoji's for me. the animated ones become pictures

use this one: parseResult.content = parseResult.content.replace(<${emoji.animated ? "a" : ""}:${emoji.originalName || emoji.name}:${emoji.id}>, https://cdn.discordapp.com/emojis/${emoji.id}.${emoji.animated ? "gif" : "webp"}?size=64);

i had the same problem as you before, and then im trying to added "gif" to the code and it works lol

Faathir81 avatar Oct 25 '24 08:10 Faathir81

Doesn't work. It says "Could not be compiled" and it gives me this error:

DiscordFreeEmojis64px.plugin.js:146 parseResult.content = parseResult.content.replace(${emoji.animated ? "a" : ""}:${emoji.originalName || emoji.name}:${emoji.id}>, https://cdn.discordapp.com/emojis/${emoji.id}.${emoji.animated ? "gif" : "webp"}?size=64); ^

SyntaxError: missing ) after argument list at internalCompileFunction (node:internal/vm:128:18) at Object.compileFunction (node:vm:364:10) at Module.N (C:\Users\dm629\AppData\Roaming\BetterDiscord\data\betterdiscord.asar\preload.js:1:4884)

It worked just fine until now.

Yadamura avatar Jan 31 '25 14:01 Yadamura

BruHh fire solution incoming🔥 just replace this clown code (lines 137 - 169) with my cleanmaxxing rizz up code:

   searchHook = function() {
        let result = Discord.original_searchWithoutFetchingLatest.apply(this, arguments);
        console.log({result, arguments})
        result.unlocked.push(...result.locked);
        result.locked = [];
        return result;
    }

    function replaceEmoji(parseResult, emoji) {
        const emojiUrl = `https://cdn.discordapp.com/emojis/${emoji.id}.${emoji.animated ? "gif" : "webp"}?size=48`; 
        parseResult.content = parseResult.content.replace(`<${emoji.animated ? "a" : ""}:${emoji.originalName || emoji.name}:${emoji.id}>`, emojiUrl);
    }

    parseHook = function() {
        let result = original_parse.apply(this, arguments);

        if(result.invalidEmojis.length !== 0) {
            for(let emoji of result.invalidEmojis) {
                replaceEmoji(result, emoji);
            }
            result.invalidEmojis = [];
        }
        let validNonShortcutEmojis = result.validNonShortcutEmojis;
        for (let i = 0; i < validNonShortcutEmojis.length; i++) {
            const emoji = validNonShortcutEmojis[i];
            if(!emoji.available) {
                replaceEmoji(result, emoji);
                validNonShortcutEmojis.splice(i, 1);
                i--;
            }
        }

        return result;
    };

DexulDev avatar Feb 07 '25 23:02 DexulDev

@DexulDev Thanks, it works hehe.

ccrsxx avatar Feb 08 '25 07:02 ccrsxx

@DexulDev It does not work :(

MountainLabz avatar Feb 24 '25 15:02 MountainLabz

@MountainLabz It should be working now—I’ve tested it today and haven’t run into any issues. I’ve submitted a PR to the plugin repository with the fix; you can check it out here if you’d like to review it: PR on GitHub. If you prefer to install the updated version directly, you can download it here: Latest version. Let me know if you run into any trouble!

DexulDev avatar Mar 04 '25 19:03 DexulDev

@MountainLabz It should be working now—I’ve tested it today and haven’t run into any issues. I’ve submitted a PR to the plugin repository with the fix; you can check it out here if you’d like to review it: PR on GitHub. If you prefer to install the updated version directly, you can download it here: Latest version. Let me know if you run into any trouble!

I used your version, not working anymore,

when i click an emote Image

i get this

Image

FahadBinHussain avatar Apr 10 '25 09:04 FahadBinHussain

It seems that "emoji" doesn't have a parameter "url", at least not anymore. Probably an update broke it and it hasn't been updated. I made a simple fix, I changed line 146 to parseResult.content = parseResult.content.replace(<${emoji.animated ? "a" : ""}:${emoji.originalName || emoji.name}:${emoji.id}>, "https://cdn.discordapp.com/emojis/" + emoji.id + ".webp" + "?size=64");

Hey, this doesn't work for me, unfortunately. I copy and pasted the line at line 146 and it still doesn't work. Instead, it sends the emojis in plain text, so an emoji named "wtf" would simply appear as :wtf:

image

i cant copy and paste into the plug in edit (in my discord settings) is there a way to copy and paste otherwise?

dhaha7 avatar Apr 26 '25 20:04 dhaha7

@DexulDev i can't copy and paste into my discordfreeemoji plugin edit in my discord settings. can you explain to me how to copy and paste into the edit button code?

Image

dhaha7 avatar Apr 26 '25 20:04 dhaha7

@dhaha7 @FahadBinHussain @MountainLabz

@DexulDev I can't copy and paste into my DiscordFreeEmoji plugin edit in my Discord settings. Can you explain to me how to copy and paste into the edit button code?

DON'T USE MY CHANGES ANYMORE — USE ANOTHER PLUGIN INSTEAD — READ EVERYTHING BEFORE DOING ANYTHING

Unfortunately, I am not able to check if the plugin changes I made are still working.
If they don't work, try installing this plugin, which emulates/bypasses Nitro features for Discord.
Features like streaming at 60fps (or custom framerates) and 1440p resolution work, and even Discord Nitro emojis work as well.
I recommend using that plugin instead of mine because it does things better, is built differently, works more efficiently, and is more customizable.

However, if you still want to try my version, I recommend using VSCode to paste the code, or you can try installing the PR I made for the plugin here.

  • I truly appreciate that you took the time to try out my version, and believe me, I’m genuinely happy to have contributed in some way.
  • However, I am not actively involved with this repository, and I don't want to take on the responsibility of constantly maintaining this change.
  • I originally made the PR just for fun and out of passion, but since it was never merged, I strongly recommend using another plugin — the one I mentioned earlier — instead of my code.

DexulDev avatar Apr 28 '25 06:04 DexulDev