# Guide on how to make a Discord.JS bot in Node-RED

**URL:** <https://discourse.nodered.org/t/guide-on-how-to-make-a-discord-js-bot-in-node-red/45824>\
**Category:** Share Your Projects\
**Created:** [18 May 2021 10:33 UTC](https://discourse.nodered.org/t/guide-on-how-to-make-a-discord-js-bot-in-node-red/45824 "2021-05-18T10:33:10Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![get\_joe](https://avatars.discourse-cdn.com/v4/letter/g/35a633/32.png) [@get\_joe](https://discourse.nodered.org/u/get_joe)\
**Post date:** [18 May 2021 10:33 UTC](https://discourse.nodered.org/t/guide-on-how-to-make-a-discord-js-bot-in-node-red/45824/1 "2021-05-18T10:33:10Z")

</div>

Hi, guys!

A couple of months ago, i tried to use google-fu to find out how to use Discord.JS and node-red together. My Google-fu came short and i did not find any guides with concrete examples. Due to this, i had to experiment on my own.

Im probably not the only one who has been looking for a guide that gets you started, so i figured i would help others in need and made this guide:  
[https://drusilla.no/2021/05/14/how-to-make-your-own-discord-bot-using-node-red-with-pictures-and-examples/](https://drusilla.no/2021/05/14/how-to-make-your-own-discord-bot-using-node-red-with-pictures-and-examples/)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [18 May 2021 10:44 UTC](https://discourse.nodered.org/t/guide-on-how-to-make-a-discord-js-bot-in-node-red/45824/2 "2021-05-18T10:44:46Z")

</div>

Nice guide Joe. 👏

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [18 May 2021 19:54 UTC](https://discourse.nodered.org/t/guide-on-how-to-make-a-discord-js-bot-in-node-red/45824/3 "2021-05-18T19:54:27Z")

</div>

Yes, I agree. Nicely written.

---

<div class="post-metadata">

**Author:** ![get\_joe](https://avatars.discourse-cdn.com/v4/letter/g/35a633/32.png) [@get\_joe](https://discourse.nodered.org/u/get_joe)\
**Post date:** [19 May 2021 15:03 UTC](https://discourse.nodered.org/t/guide-on-how-to-make-a-discord-js-bot-in-node-red/45824/4 "2021-05-19T15:03:41Z")

</div>

Thanks, appreciate it! Your guidance on cloning of objects helped a lot, @Steve-Mcl :- ).

---

<div class="post-metadata">

**Author:** ![OriolFM](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/oriolfm/32/30710_2.png) [@OriolFM](https://discourse.nodered.org/u/OriolFM)\
**Post date:** [16 November 2021 15:23 UTC](https://discourse.nodered.org/t/guide-on-how-to-make-a-discord-js-bot-in-node-red/45824/5 "2021-11-16T15:23:44Z")

</div>

You're right, there's an extreme lack of tutorials in that regard. I was quite happy to see it and I can't wait to test it.

These last few days I've been trying the [discord-advanced](https://flows.nodered.org/node/node-red-contrib-discord-advanced) nodes and they're good for receiving messages, but they do not keep the discord API message structure (I wonder why), and couldn't figure out how to do things as basic as replying to a message (including the quote to the original message).

For now, my bot it's just parsing the messages to generate random number sets (to play my own homemade tabletop RPG) but I want to add more functionality, so node-red is able to parse the character sheets in JSON format and keep track of the people's stats during a game.

Step by step.

Thanks for the effort!

---

<div class="post-metadata">

**Author:** ![get\_joe](https://avatars.discourse-cdn.com/v4/letter/g/35a633/32.png) [@get\_joe](https://discourse.nodered.org/u/get_joe)\
**Post date:** [16 November 2021 16:19 UTC](https://discourse.nodered.org/t/guide-on-how-to-make-a-discord-js-bot-in-node-red/45824/6 "2021-11-16T16:19:59Z")

</div>

Hopefully you'll find it usefull! Using the function-node to handle discordJs is the most versatile option. You can do whatever you want as long as your discordJS version implements it :- ).

The reason why discord-modules does not forward the object through the flow is because it causes node-red to crash if the flow is branched(i touched upon it in the guide).

if you'd like, you could check out my own discord node.  
Examples:[node-red-contrib-discord-js/EXAMPLES.md at main · Mar10-9us/node-red-contrib-discord-js · GitHub](https://github.com/Mar10-9us/node-red-contrib-discord-js/blob/main/EXAMPLES.md)  
Node:

> **[node-red-contrib-discord-js-drusilla](https://flows.nodered.org/node/node-red-contrib-discord-js-drusilla)**
>
> A node-RED module that implements Discord.js v. 12.5.3 in node-RED

I am also in the midst of developing another discord module for more advanced users which is based on the different types of managers, its members and its methods in discordJs. This means that you in a larger degree can reference to the official discordJs documentation. Example of a manager which handles messages:

> **[Discord.js](https://discord.js.org/#/docs/main/stable/class/TextChannel)**
>
> Discord.js is a powerful node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to...

Not sure when i'll able to release it due to hectic work situation :- )

---

<div class="post-metadata">

**Author:** ![OriolFM](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/oriolfm/32/30710_2.png) [@OriolFM](https://discourse.nodered.org/u/OriolFM)\
**Post date:** [16 November 2021 19:20 UTC](https://discourse.nodered.org/t/guide-on-how-to-make-a-discord-js-bot-in-node-red/45824/7 "2021-11-16T19:20:20Z")

</div>

Sounds really good! 🙂

For now, I managed to do a simple parser to identify a dice rolling command that will produce the results, but I wanted to mention or reply directly to the user that created the command, and with the node I had is impossible. I'll give yours a try, or I'll delve in the tutorial you wrote.

Thanks again!

---

<div class="post-metadata">

**Author:** ![Mr-Lift](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mr-lift/32/68233_2.png) [@Mr-Lift](https://discourse.nodered.org/u/Mr-Lift)\
**Post date:** [24 September 2022 09:51 UTC](https://discourse.nodered.org/t/guide-on-how-to-make-a-discord-js-bot-in-node-red/45824/8 "2022-09-24T09:51:30Z")

</div>

the url shows a blank page

---

<div class="post-metadata">

**Author:** ![PapaChicken](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/papachicken/32/70289_2.png) [@PapaChicken](https://discourse.nodered.org/u/PapaChicken)\
**Post date:** [29 November 2022 20:37 UTC](https://discourse.nodered.org/t/guide-on-how-to-make-a-discord-js-bot-in-node-red/45824/9 "2022-11-29T20:37:52Z")

</div>

Your link shows a blank page. Is this still maintained?

---

<div class="post-metadata">

**Author:** ![get\_joe](https://avatars.discourse-cdn.com/v4/letter/g/35a633/32.png) [@get\_joe](https://discourse.nodered.org/u/get_joe)\
**Post date:** [29 November 2022 21:17 UTC](https://discourse.nodered.org/t/guide-on-how-to-make-a-discord-js-bot-in-node-red/45824/10 "2022-11-29T21:17:42Z")

</div>

Sadly it is not. I deleted the website... There is a copy of the tutorial available using thewaybackmachine, but it does not contain pictures. [How to make your own Discord-bot using Node-red (with pictures and examples) – Drusilla](https://web.archive.org/web/20220125113722/https://drusilla.no/2021/05/14/how-to-make-your-own-discord-bot-using-node-red-with-pictures-and-examples/)

---

<div class="post-metadata">

**Author:** ![PapaChicken](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/papachicken/32/70289_2.png) [@PapaChicken](https://discourse.nodered.org/u/PapaChicken)\
**Post date:** [29 November 2022 21:29 UTC](https://discourse.nodered.org/t/guide-on-how-to-make-a-discord-js-bot-in-node-red/45824/11 "2022-11-29T21:29:33Z")

</div>

Oh no! What happened? Thanks for the link. I find that those tutorials are important. You need a space to share this?
