Discord.js: "Cannot Send an Empty Message" Error If Message Is an Emoji or Not a "Normal" Character

Created on 11 Oct 2017  Â·  3Comments  Â·  Source: discordjs/discord.js

Please describe the problem you are having in as much detail as possible:
If the message being sent is not a "normal" character (ex: ( ͡° ͜ʖ ͡°)), a "cannot send an empty message" error happens.

Include a reproducible code sample here, if possible:

client.on('message', message => {
    let test = "🅱"
    message.channel.send(test);
    //DiscordAPIError: Cannot send an empty message
});
client.on('message', message => {
    let otherTest = "( ͡° ͜ʖ ͡°)"
    message.channel.send(otherTest);
    //DiscordAPIError: Cannot send and empty message
});

Further details:

  • discord.js version: 11.2.1
  • node.js version: v6.11.4
  • Operating system: Windows 10
  • Priority this issue should have – please be realistic and elaborate if possible: Not super high, but def breaks some quote systems that contain emojis/faces

  • [ ] I found this issue while running code on a __user account__
  • [ ] I have also tested the issue on latest master, commit hash:
high REST bug

Most helpful comment

The issue has been fixed with the latest snekfetch release.

All 3 comments

Thanks for the bug report! We were scratching our heads in the staff channel trying to reproduce the bug, but you've figured it out for us.
The current fix is to downgrade to snekfetch 3.4.5 on master, so if you need your bot to be up, just run npm i [email protected] and you should be up and running again.
Hopefully we'll have a better fix for this later.

For those who use Yarn, try https://yarnpkg.com/en/docs/selective-version-resolutions:

  "resolutions": {
    "discord.js/snekfetch": "3.4.5"
  }

or something like that..

The issue has been fixed with the latest snekfetch release.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Blumlaut picture Blumlaut  Â·  3Comments

tom-barnes picture tom-barnes  Â·  3Comments

Alipoodle picture Alipoodle  Â·  3Comments

BrandonCookeDev picture BrandonCookeDev  Â·  3Comments

kvn1351 picture kvn1351  Â·  3Comments