Learn to Code via Tutorials on Repl.it!

← Back to all posts
Tutorial: Building a Discord bot with Node.js
GarethDwyer1 (295)

Hey all,

This is the Node.js version of my tutorial on building Discord chatbot's (the other version is in Python). I'm watching the comments here and at codementor, so shout if you have any questions!


MrSarthak (4)

how to type??????

Brawn (5)

Two questions
1)Could you do all of the steps in a browser or do you need the app to do it?
2)Is the code too advanced for a beginner, or is it do able with the basics?
I am a newbie in programming "for now" and I was interested in this challenge hoping that I could learn some js during the process. I would also love some tips for how to learn a language for a beginner like myself.
I would also like to hear your opinion on Rust, which I am attempting to learn. Things like is it too hard for a new comer and if it is worth learning

ChristopherRoch (1)

@Brawn To try and answer your questions:
1. Yes. Repl.it has a built-in IDE that can work in Node.js, and you can access Discord in the browser (though I'd personally recommend to use the app).
2. I would say that a Discord bot is a great way to start programming. You'll be working with mostly discord.js' functions, which read very much like English, and only need to know things like if statements, and for loops.

As for Rust, I've never played it so I can't comment.

Hope this helped!

Nathan_42 (2)

@ChristopherRoch Lol hes talking about the programming language

1avpinksfeld (0)

how and where do i learn if i have no coding experience?

Albxyiscool (1)

How do i make a command

GarethDwyer1 (295)

@Albxyiscool just check if the input starts with an exclamation mark or however you want to run your commands. e.g.

if(message.charAt(0) == '!') { // logic for your command }
bobjeffco (5)

thank you for this tutorial! it works very well.

ryosan1210 (2)

I'm Japanese so I can't write English well. I'm sorry.

I have a question.
I can't run my project. There is sentence in console.
It is "exit status 127".
So I can't run my project.

GarethDwyer1 (295)

@ryosan1210 can you share a link to your project?

GarethDwyer1 (295)

[email protected] your .replit file is wrong. Change the 'run=' line to

run = "node main.js"
ryosan1210 (2)

@GarethDwyer1 I can run my project!