[Tutorial] How to make a simple discord bot, In Javascript.
#2

By recommending VSCode, do you have any real reason for recommending it or is it just because you use it? It'd be good for you to explain why you recommend certain editors. Personally, I prefer to use VSC as well, but I know a great amount of people like to use other editors like Sublime, etc.

Also, this isn't necessarily a major issue but a nitpick. Most of this tutorial is text, which makes it less of a convenience to read through it and therefore, I'd suggest using more screenshots.

Furthermore, some lines are poorly explained for people new to this.
Major offenders such as:
Code:
const Discord = require("discord.js") // We require discord.js’s library
const client = new Discord.Client() // We initialize it by calling Client()
There's absolutely no reason for comments here as they say nothing at all: either make them useful or not at all.

I'd recommend adding a section about commands as most bots aren't going to be this simple.
For anyone who wants to know how to make a basic command:
Code:
const Prefix = "!"

if(msg.content === `${Prefix}cmdhere`)
Finally, you should be splitting your message if you're going to use arguments (which most bots are going to use, otherwise it's pretty pointless).

Code:
let array = message.content.split(" ");
let command = array[0]; // changed from your msg
let args = array.slice(1); // slice it again as there may be multiple arguments
Reply


Messages In This Thread
How to make a simple discord bot, In Javascript. - by JasonTheMan - 12.05.2020, 15:39
Re: How to make a simple discord bot, In Javascript. - by Proxus - 12.05.2020, 16:16
Re: How to make a simple discord bot, In Javascript. - by JasonTheMan - 12.05.2020, 18:39

Forum Jump:


Users browsing this thread: 1 Guest(s)