When on Windows, you can open a new CMD window using the shortcut CTRL+R, then typing cmd and pressing enter. I will be using the stock command prompt Windows offers. Open this folder with a terminal to your liking. Create a new folder with a name to your liking. But first:Īs with any Node project, we will have to prepare a project folder. We will come back and fetch the token soon. Congratulations! You've made your first bot! Anyway, what's important now is the token. Press Add Bot and confirm you want to create a new bot. On mobile you'd have to open the navigation bar first by clicking the hamburger menu icon). However, this isn't actually a Discord bot yet. Keep in mind that this will also be the name of your bot. You can name the application anything you'd like. At the top left there should be a button "New Application", click that. You can obtain this key by making a new application in the Developer Portal. To interact with the API you will need an API key. I recommend you to have at least 2 tabs open during this series of articles: Information about the API can be found here. In the current master branch they interact with Discord API version 8. You should keep this in mind when building Discord bots (or any type of application that interacts with an API). It takes care of the nasty stuff, like sending and receiving requests. Discord.js is nothing more and nothing less than an abstract layer between you and the Discord API. interact with the **Discord API* very easily.*". Let us zoom in on a part of this paragraph: ". It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend. What is discord.js anyways?ĭiscord.js is a powerful Node.js module that allows you to interact with the Discord API very easily. Having a solid foundation is key to understanding and remembering a complex subject. In order to make something stick and make sense, you'll want to get the basics down (the trunk and big branches). the trunk and big branches, before you get into the leaves/details or there is nothing for them to hang on to.” ~ Elon Musk “It is important to view knowledge as sort of a semantic tree - make sure you understand the fundamental principles, i.e. Discord.js requires Node.js version 14.0.0 or newer. Again, Google is your friend in case you're unsure as to how to install Node.JS properly. As this is an article about Discord.js solely, I wont be going in to the specifics here. Node.js and NPM installed on your machine.Don't be scared to use Google, DuckDuckGo, or any other search engine. There are innumerable fantastic resources out there, like freeCodeCamp. I've seen this all too much, eager new developers asking to be spoon-fed basic Javascript and Node.js fundamentals. At least beginner knowledge of Javascript.However, there are certain prerequisites. I will be using the new discord.js v13 library. In this, and the following articles I will introduce beginners to the magical world of Discord bots. Hello there, this sentence will mark the beginning of my first ever article released to the public.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |