Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Couldn't send discord message: "Message content must be a non-empty string" #2723

Closed
1 task done
twity1337 opened this issue Aug 12, 2021 · 3 comments
Closed
1 task done

Comments

@twity1337
Copy link

twity1337 commented Aug 12, 2021

Expected Behavior

A discord notification is expected.

Current Behavior

When I try to set up discord notifications with streetmerchant, I receive the following error on Stock-Alarms.
Even testing the Notifications with the following Docker command shows the same exception message:

docker run -it --rm  \
  --env-file ./dotenv \
  ghcr.io/jef/streetmerchant:nightly test:notification:production

What operating system are you seeing the problem on?

Linux

Relevant log output

This is the stack trace that I receive on stock alarms:

error :: ✖ couldn't send discord message Message content must be a non-empty string. {
streetmerchant    |   "stack": "RangeError [MESSAGE_CONTENT_TYPE]: Message content must be a non-empty string.
    at Function.verifyString (/app/node_modules/discord.js/src/util/Util.js:414:49)
    at MessagePayload.makeContent (/app/node_modules/discord.js/src/structures/MessagePayload.js:113:22)
    at MessagePayload.resolveData (/app/node_modules/discord.js/src/structures/MessagePayload.js:128:26)
    at WebhookClient.send (/app/node_modules/discord.js/src/structures/Webhook.js:165:61)
    at /app/build/src/messaging/discord.js:58:30
    at new Promise (<anonymous>)
    at /app/build/src/messaging/discord.js:56:35
    at Object.sendDiscordMessage (/app/build/src/messaging/discord.js:76:11)
    at Object.sendNotification (/app/build/src/messaging/notification.js:27:15)
    at lookupIem (/app/build/src/store/lookup.js:260:21)"

Configuration

ASCII_BANNER=false
ASCII_COLOR=true
AUTO_ADD_TO_CART=false
BROWSER_TRUSTED=true
DISCORD_NOTIFY_GROUP=
DISCORD_NOTIFY_GROUP_SONYPS5C=
DISCORD_NOTIFY_GROUP_SONYPS5DE=
DISCORD_WEB_HOOK=https://discord.com/api/webhooks/000000000000000000/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
HEADLESS=true
IN_STOCK_WAIT_TIME=30
INCOGNITO=
LOG_LEVEL=
LOW_BANDWIDTH=true
MAX_PRICE_SERIES_SONYPS5C=700
MAX_PRICE_SERIES_SONYPS5DE=
OPEN_BROWSER=false
PAGE_BACKOFF_MIN=
PAGE_BACKOFF_MAX=
PAGE_SLEEP_MIN=120000
PAGE_SLEEP_MAX=180000
PAGE_TIMEOUT=
PLAY_SOUND=false
RESTART_TIME=
SCREENSHOT=
SHOW_ONLY_BRANDS=
SHOW_ONLY_MODELS=ps5 console
SHOW_ONLY_SERIES=sonyps5c
STORES=alternate-de,amazon-de,gamestop-de,mediamarkt,saturn,medimax,otto,spielegrotte

Code of Conduct

  • I agree to follow this project's Code of Conduct
@twity1337
Copy link
Author

twity1337 commented Aug 13, 2021

I had a look into this and found out, that it can be solved by setting a group text (any string in DISCORD_NOTIFY_GROUP). So this seems to be a Workaround.

I just fixed this by setting a space as content, if no group has been provided. I'm going to submit a PR soon.
EDIT: Ahh, I just saw the mentioning 😅 Well, then my PR is not needed, good!

@jef
Copy link
Owner

jef commented Aug 13, 2021

Good find. Thank you!

@jef
Copy link
Owner

jef commented Aug 13, 2021

Fixed in #2714

@jef jef closed this as completed Aug 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants