How To Use Node Js Discord
If you re developing on windows it s as simple as installing any other program.
How to use node js discord. In this tutorial you will build a discord bot from scratch using node js and the discord js library which allows users to directly interact with the discord api. Using a library makes all very easy since the tiny details are abstracted for us. You ll set up a profile for a discord bot get authentication tokens for the bot and program the bot with the ability to process commands with arguments from users. Pick the installer for your operating system and install it as you would any application. You can do so by going to the node js website.
Installing on windows. So type the following. The app offers a great guide and a nicely organized api documentation. Discord is a popular voice and chat app for gamers and non gamers who use it to communicate with their friends without paying for a voice server like before. In this tutorial you will build a discord bot from scratch using node js and the discord js library which allows users to directly interact with the discord api.
You ll set up a profile for a discord bot get authentication tokens for the bot and program the bot with the ability to process commands with arguments from users. We ll use the discord js library to create our bot. Discord is an instant messaging application mostly used by developers and gamer communities. Step 2 create a discord account server and bot application before we do any coding let s head over to discord and get the infrastructure we need up and running. Step 1 install node js head over to download and install node js.
Go to the node js website download the latest version open up the downloaded file and follow the steps from the installer. Almost every big server has a discord bot which can be used for managing it administrative commands like ban and kick gifs and playing music. If you have node js installed create a folder and run this command inside the folder using cmd npm init y npm install discord js then create a file called index js which will have all the code to control the bot. It s obvious we need the second. The project depends on two dependencies dotenv and discord js the first dependency allows us to use a env file that holds the bot token we have written down.
So in the file we will have to first connect javascript with the discord bot.