How to make a Discord bot?

If you are looking for a platform where you can send messages instantly and video chat with your friends and family, then there is no better platform to do it than Discord. The company has proved to be an incredible messaging platform not just for gamers but for others as well. One of the reasons why this platform is becoming more and more popular is because it has Discord bots.

These bots can help you play music across the server. Moreover, they help you perform automated mundane tasks. If you wish to learn how to make a Discord bot, then take a look below. 

Discord is particularly used for automation. The great thing is that you don't need any programming language to get this work done. Without further ado, let's move on with the process to make discord bots.

Step 1: First of all, you need to set up a Discord account. For this, you need to download Node.js. It is a javascript runtime, which is open source and free. Plus, you need it to make your bot work. In case you have not created one yet, then go to the main website of Discord and create one. In case you have one, then log in to your Discord account and launch the server in which you wish your bot to live. Additionally, you will require a text editor program such as Notepad++ on Windows that you can use to code with. 

Step 2: After that, you are required to create an application on Discord to make the bot work. This process can take a while as it is a complex process. Here, you need to get the authorization token for the bot. This will allow Discord to recognize your code and add it to the bot on the servers. Firstly, you need to go to discordapp.com/developers/appications/me. After that, you need to ensure that your account is logged in.

This will directly take you to the list of apps on your account. Select the new application to get started. You need to give your bot a name and then select Save Changes. 

After that, go to the right-hand menu and then select Bot. When you get to the new menu, select the Add Bot option given under Build a bot. In case you have only one app, then it will appear automatically. 

Step 3: In the App Bot User box, search for the words  Toke: Click to Reveal. Select the link and then you will see a string of text. This is the authorization token of your bot. This will allow you to send the code. You must not share this code with anyone. You must not share it with anyone. This token will allow a user to create the code for the bot. This means that any person who has I can control your bot.  If you find that your token has been compromised, then you can generate a new one by clicking on the Generate a new Token button.  

Step 4: After that, go to App details and then search for client ID. It is a long number that you need to copy and add to the URL and replace the word CLIENT ID with it. Now, you will be taken to a website where you inform discord where to send the bot. After that, the channel will inform you that the bot has joined the room. You will view this on the right-side menu below the online members list. 

Step 5: While doing this, you can make a folder on your system that will take you to an easy-to-reach place. You can store all your bot files in this folder. You can give the "DiscordBot" name to this folder. 

Step 6: After that, you will create three files for your bot by going to the text editor. Firstly, paste the code: "token": "Your Bot Token". Replace it with the token that was generated on the application page earlier. Please ensure that the token is within the quotation marks. After that, you are required to save the file in the Discord bot folder. Please don't save it as a .txt file. it must be saved as .json. Create a new file and then enter this code. 

{

“name”: “greeter-bot”,

“version”: “1.0.0”,

“description”: “My First Discord Bot”,

“main”: “bot.js”,

“author”: “Your Name”,

“dependencies”: {}

}

Replace the name of the author with your name if you like. You can also change the description as per your wish. It needs to be something that is more in line with what you are making. This will help you remember what your bot is required to do. Save this file in your Discord Bot folder as "package.json".

  • Mick Jone
  • Category: How-to
  • Last Update: 1 week ago