Sending messages in Discord threads with discord.send_message

Hello, I’m currently using Pipedream to feed RSS messages into a Discord channel. I would like to send them to a thread but don’t see the thread as an option in Pipedream. Can this be added?

1 Like

Just want to second this. I tried to see if I could somehow append the thread_ID info to the post method, but I couldn’t figure out how to successfully add it.

1 Like

@detection @enigmalea thank you for the request! I added support for threads to the Send Message and Send Message (Advanced) actions:

You should be able to update your action to the latest version to use the newest code.

Let me know if that works for you!

If you’re interested, here’s the PR on GitHub with the changes I added to support threads. I’m not sure if you were aware, but the code for all of these actions are on GitHub and are available for anyone to edit.

If you have other suggestions about how we can improve these actions, let us know!

Thanks for the quick reply, Dylan!

I’m trying to test it out now but I’m not seeing a little update icon, and I still don’t see my thread in the channel list. Do I have to input something manually?

I’m also wondering if this is possible for the “Send Message to Channel” option?

@detection the Send Message to Channel action is an older version of our Discord actions. Would you mind adding the Send Message action (the one labeled Beta) to your workflow, and see if that works? That’s the one I updated just now, and should support the same options, including Thread ID.

Note: if you need to send a message with Embeds, instead, use the Send Message (Advanced) action (also labeled Beta).

Let me know if that works.

@dylan I’m struggling a little bit here. I had a code for an embed which worked fine in Send Message to Channel as long as I turned off the old “structured mode” setting, but when I try to migrate to Send Message (Advanced) I’m receiving discord’s 400 malformed embed error.

I’ve attempted just about everything I can think of. I checked the Github for Send Message (Advanced), and it looks like the “embeds:” property is being passed by you, so I’ve just passed the array. I’ve tried going back to a simple embed with just a set title and color (not using any of the data I parsed between the RSS feed and the embed).

I even got desperate enough at one point to try JUST sending {{ [{"description":"Test"}] }} instead of using my Node.js return value where I form the embed.

All of these are giving me a 400 error.

I’m stumped.

@enigmalea would you mind clicking the Share button at the top-right of your workflow and share it with I’d like to take a look at the specific error to see if I can help troubleshoot.

Would you also mind if I modify the code / trigger the workflow with a test event? That will help me figure out what’s going on.

@dylan I’ve shared it with all of the edits I’ve attempted so far. I actually shared the original method as a Tutorial over on Github Gist. You can find that code here.

I’m admittedly not super familiar with JS or Node.js, so it could be something very obvious that I’m missing.

Feel free to send any test events you want. It goes to my private discord I use for testing things. :slight_smile:

@enigmalea I apologize for the delay in getting back to you. I pushed a fix to the Discord Advanced action, and I’ve modified your workflow to use the new version. I triggered a test event, so you should see the message in your Discord server.

I also added logic to return the error Discord returns in the HTTP response, so the error should be more obvious next time, instead of just a generic 400 error.

Let me know if that works for you.