Closed jerome6994 closed 2 years ago
the default behaviour of the discordMessageManager is to request for a text inside msg.payload.
If you want to send only embed without any text you can do the follow:
msg.payload = "";
Thank you for your quick response, however I do not understand the subtlety of this one. I think it comes from my youth on Node Red and its environment but I can't fix what I started doing at all I wanted to start with a simple message and then increase the difficulty with the insertion of images from my cameras etc. Your work is excellent for a novice like me it is difficult without an example from start to finish but I do not despair
The most simple message with de discordMessageManager:
[
{
"id": "bbe6e51927b4a2c0",
"type": "debug",
"z": "4bde5831221f6bb2",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 770,
"y": 60,
"wires": []
},
{
"id": "709a8f3baf4e320e",
"type": "discordMessageManager",
"z": "4bde5831221f6bb2",
"name": "",
"channel": "",
"token": "",
"x": 550,
"y": 60,
"wires": [
[
"bbe6e51927b4a2c0"
]
]
},
{
"id": "ca2521669295ab88",
"type": "function",
"z": "4bde5831221f6bb2",
"name": "",
"func": "msg.payload = \"Hello there\";\nmsg.channel = \"111111111111111\"; // Your channel ID\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 340,
"y": 60,
"wires": [
[
"709a8f3baf4e320e"
]
]
},
{
"id": "373865a8cf8a50c6",
"type": "inject",
"z": "4bde5831221f6bb2",
"name": "",
"props": [],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"x": 150,
"y": 60,
"wires": [
[
"ca2521669295ab88"
]
]
}
]
Thanks for the help I even managed to embed ok i woke up at 4:00 in the morning :)
On the other hand for the colored text it seems not possible visually on the phone but just on the app and the browser ?
Good evening
I still have a usage question. Attached is my flow with the Home Assistant sensors.
What I have in discord mobile app
What i have in discord app windows
To integrate the sensors in my message I use payloads with the call services But with your node the payloads do not pass! I don't have to write it right yet... Not easy to start on node red because every day is a discovery !
`const msg1 = {};
msg1.channel = "911259838544228402"; msg1.payload = "Message de Node Red"; msg.message = "msg.message" msg1.embeds = { color: '#111111', title: "Ephéméride du " & payload.date_jour & "__", description: "Description du message", author: { name: "le nom de l'auteur", icon_url: 'https://i.imgur.com/AfFp7pu.png', url: 'https://discord.js.org', }, thumbnail: { url: 'https://i.imgur.com/AfFp7pu.png', }, fields: [ { name: ":innocent: Saint du jour", value: payload.saint_jour, }, { name: ":innocent: Saint de demain", value: payload.saint_demain, inline: false, }, { name: ":sunny: Météo du jour", value: payload.meteo, inline: false, }, { name: ":sunrise: Lever du soleil__", value: payload.lever_soleil, inline: true, }, { name: ":first_quarter_moon_with_face: Coucher du soleil", value: payload.coucher_soleil, inline: true, }, ], image: { url: 'https://i.imgur.com/AfFp7pu.png', }, timestamp: new Date(), footer: { text: "Envoyé par Node-Red --- " & time, icon_url: 'https://i.imgur.com/AfFp7pu.png', }, };
return msg1; `
thanks for your help again
I invite you to have this discussion on the discord server if you want. In the last version of the package (3.2.2), all the input message is kept in the output. The msg.payload field is used by the node, and is a pattern within Node-red use payload for the specific input parameters for the node. You can change properties to copy data outside of the msg.payload if you want. I'm gonna close the issue.
Hello, I'm new to Node Red. I discovered your work which seems to meet my expectations when reading it but I find it difficult to put it into practice I'm doing a test on a classic flow in order to see all the options on a message but I have errors so I decided to reduce the number of options in order to target the error. I have this error: TypeError: Cannot read properties of undefined (reading 'content') and I don't see who generates it
My flow is :
My function is :
Thank you for your help in correcting my error.