Cannot send direct message using Discord Node: node-red-contrib-discord-advanced


I am having troubles using the node „node-red-contrib-discord-advanced“. I created the bot and can successfully use the node „discordMessageManager“ to send messages to an existing channel.

When I try to send messages directly to a user the node throws this error:
‚DiscordAPIError: Invalid Form Bodyuser_id: Value „Username“ is not snowflake‘

Simple inject node:

Anybody an idea what I am doing wrong?

Untested but

msg.user is probably wrong. It should be a string of numbers like the msg.member.userID

If you don't know what your's is:
Connect a discordMessage node to a debug node set to output the "complete msg object", and send a test message in your discord server for it to pick up. The debug output will contain the msg.member.userID

1 Like

Thanks. You are right. Need to put in the number based ID.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.