How To Make A Discord Bot Step by Step (WITH PICTURES)

0
1821
How To Make A Discord Bot Step by Step (WITH PICTURES)

Discord is mainly a communication platform. Discord is widely used by tons of people around the world because of its seamless functionality, cross-platform support and flawless features which have set-up a bar to measure industry standards, we are going to learn how to make a discord bot in this guide and also how to delete it.

Majorly, discord is used by gamers and internet communities who want to hang out together and share and discuss stuff on a variety of topics. The best part about this is that anyone can create a Discord server for free and make his/her community. You can invite anyone to your server, let it be your friends or family, or acquaintances on the internet.

A discord server makes it very easy to stay in touch with the members of your communities and its much more easier to communicate with them in the form of memes, songs and multimedia messages on discord.

As your discord server starts getting populated, it gets more and more exhausting to moderate your server on your own. This is where Discord Bots come into the picture. Discord bots can be used to moderate servers, automatically track messages, greeting new members, playing music in the server upon a users request, keep track of game-play hours, etc. There are tons of other features too which make it simple to manage multiple servers at once.
Javascript is generally used to code Discord Bots. All these discord bots, which perform such complex tasks are coded in one programming language, i.e., JavaScript.

Why Is There A Need For Discord Bot?

Discord by default does not provide the tools, features or the means to manage and moderate servers. By using discord bots, you can efficiently manage multiple servers at once. It even makes it easier to moderate these servers by blacklisting certain words, links, and spam. Auto-moderation of servers becomes a life-saver when your server gets populated with tons of users, and you get hold of the messages coming in every second.

Discord bots also provide other features like message tracking, recording gameplay hours, games and quizzes to keep the members entertained.

How To Make A Discord Bot :

In order to learn and create how to make a bot on discord, you need to perform a certain number of steps in a systemic manner to ensure that the bot is built properly and deployed on your discord server. Given below are the steps you need to follow to make and know how to set up bots in discord:

1. Setting Up The Essentials:

In order to make a discord bot, you need a JavaScript run-time. For this, you can use Node.js which is currently one of the best and easy to use JavaScript run-time. Not only that, it is available for free as it an open-source program. You can download Node.js from this link. Install it before you do anything. After this create a Discord account to create a server and to test your bot. You will also need a text editor to edit a few lines of code. If you’re on Windows, Notepad++ is the best text editor program to go with.

2. Creating Your Bot:

First login into your discord account and then head over to discordapp.com/developers/applications/.  Click on Create an application. Give your bot a name and click Save Changes.

how to make a discord botNow go to Bot tab present on the menu which is located at the left-hand side. Click on Add Bot located right next to the BUILD-A-BOT option. You will be asked to confirm your action. In just a few seconds, your bot should automatically appear on the developers’ dashboard.

best discord bots for fun

3. Retrieve Your Bot’s Authentication Token:

In this step, you will retrieve your bots authentication token so that you can send your code to it. To retrieve your authorization token, open your application and go to the Bot tab present on the left-hand side menu. Under BUILD-A-BOT option you will find a label named Token. This is your authorization token. Click on “Click to Reveal Token” and copy the string which comes up. You’re going to need it in a few minutes.

how to make a bot on discord

You can also generate a new token if you feel that it has been compromised by clicking on “Regenerate“.

4. Deploy Your Bot On Your Server:

To deploy your bot to your own server, you first need to head over to the General Information tab where you will find your CLIENT ID. Copy the CLIENT ID and replace it in the following URL where it says CLIENT ID.

https://discordapp.com/oauth2/authorize?&client_id=CLIENTID&scope=bot&permissions=8

Your final URL should look like this:

https://discordapp.com/oauth2/authorize?&client_id=520621111831035907&scope=bot&permissions=8

Now copy the final URL and paste it in the address bar of your browser. You will be redirected to a page where you will be asked to select the server where you want to send your bot. After selecting the server, click on Authorize.

how to set up bots in discord

To know if it worked, you can simply open up your discord server and check whether the bot is added in your server. If you’ve done everything correctly till now, you should see a similar screen.

how to remove a bot from discord

5. Create Your Bot’s Files:

Before you start making files for your bot, create a folder on your desktop so that its easily accessible and your bot’s files are organized. You are going to create three files in this folder. Create three text documents in the folder and use any of your favorite text editors to edit them. In my case, I’ll be using Notepad++.

Open the first text document and copy and paste the following code in it:

{
“token”: “Your Bot Token”
}

Replace “Your Bot Token” with the authorization code you copied earlier. Now re-name the file as “auth.json” and save it.

Next, open another text document and copy paste the following code:

{
“name”: “demo-bot”,
“version”: “1.0.0”,
“description”: “My Discord Bot”,
“main”: “bot.js”,
“author”: “Name”,
“dependencies”: {}
}

Now replace the author name with your name or keep it as it is. If you want to change the description of your discord bot, change the text next to the description under “My Discord Bot”. This is just to make your discord bot unique and stand out from others. After you finish editing, save the file as “package.json”.

There’s one last file you need to make. This file will define your bot. Open up another text document in the folder with your text editor of choice and copy paste the following code:

var Discord = require('discord.io');
var logger = require('winston');
var auth = require('./auth.json');
// Configure logger settings
logger.remove(logger.transports.Console);
logger.add(new logger.transports.Console, {
colorize: true
});
logger.level = 'debug';
// Initialize Discord Bot
var bot = new Discord.Client({
token: auth.token,
autorun: true
});
bot.on('ready', function (evt) {
logger.info('Connected');
logger.info('Logged in as: ');
logger.info(bot.username + ' - (' + bot.id + ')');
});
bot.on('message', function (user, userID, channelID, message, evt) {
// Our bot needs to know if it will execute a command
// It will listen for messages that will start with `!`
if (message.substring(0, 1) == '!') {
var args = message.substring(1).split(' ');
var cmd = args[0];
args = args.splice(1);
switch(cmd) {
// !ping
case 'ping':
bot.sendMessage({
to: channelID,
message: 'Greetings, Human! Welcome to TheDigitalWise server.'
});
break;
// Just add any case commands if you want to..
}
}
});

Save the file as “bot.js”. The code above makes your discord bot automatically respond to certain messages which start with “!” character. For example, we have defined a feature !intro. Anyone who comes to your server and types the !intro command into the server, the bot will automatically respond with the pre-defined message we have saved. In this example, the pre-defined message is “Greetings, Human! Welcome to TheDigitalWise server.” You can easily change both; the prompt message and the command, by editing the above code.

6. Install Your Bot’s Dependencies:

Now that you have all the code set up, its time to make use node.js to install dependencies for your bot.

how to make a discord bot

For that, first, you need to open the folder where you have placed your discord bot files. Hold the Shift key and right-click anywhere inside the folder. From the drop-down menu select the “Open Command Prompt” option.

Once the command prompt is open, type the following command in the command line:

npm install discord.io winston –save

This command will automatically create all the necessary dependencies and install all the necessary files in your discord bot folder.

7. Run The Bot:

This is the last step where you need to type “node bot.js” in the command prompt to run your bot. Now go back to the Discord server and test your bot by typing “!intro,” or “!” followed by your prompt message as defined in the “bot.js” file. The bot will respond with the pre-defined message you have set in the bot.js file. If you’ve followed all the steps properly, you should get a response from your bot with the pre-defined message.

Bonus Tip (Make your task super easy by just finding out that the bot you want to create has been made by someone else before or not)

As you already know that gamers have a massive community of people making stuff for their variety of specific predefined tasks. They also make a lot of quality stuff to enhance user experience and to offer more functionality.

There is a giant database of bots which are made by other people that perform a variety of functions and the best thing about it is that you can easily find and use others creativity to reuse in your own bot.

discordbots.org and bots.discord.pw are the two major portals where you can find tons of discord bots created by other developers.

Besides those portals, you can simply google about the bots and check whether there are similar bots to the ideas you have in mind. You can also try a search for discord bots on other discord forums and similar places.

Best Discord Bots For Fun

There are hundreds of discord bots out there. Some of them are made for fun to enhance a server’s chat experience while others are simply made for better communication between users.

Here’s a short list of best discord bots which you should definitely check out :

  1. Medal bot – To record gaming clips on Pc and mobile.
  2. Pokecord – It’s a bot which allows you to catch, train and battle Pokemon’s with your friend in discord.
  3. Mudae – It allows you to play original multiplayer games and much more like thousands of pre claimed characters and catch pokemon at gyms and rocket casino.
  4. Pokeverse (Snowy Fantasy) – It allows you to spawn, battle, bread, travel, gyms and much more.
  5. Box bot – It’s a fun bot in discord in which you can choose random boxes to get random items to attack your friend.
  6. Dank memer – You can get memes, image manipulation, memes gambling, and stupidity all in a single bot of discord of it.
  7. Idle RPG – You can get shop system, classes, dungeons, items, PvP, economy and much more in it.
  8. OWO – Hunt for animals to fight other users, track your owo’s and compete globally.
  9. Pancake – Multi tasking bot for discord like music, moderation, fun and more. Simple and easy to use.
  10. Nadeko – It contains a lot of games, gambling, administration tools, fun commands and much more.

How To Remove A Bot From Discord:

Now that you know how to create and install a discord bot, you should also how to remove a discord bot from the server. The process is very simple and will take 2 minutes of your time to execute. Below are the steps you need to follow to remove a discord bot from your server:

Step 1: Login to your discord account and choose the server to want to remove the bot from.

Step 2: Find the bot which you want to remove and right-click on it. A drop-down menu will appear.

Step 3: Click on the Kick Bot option and the bot will get automatically removed from the specific server.

These are the simple steps using which you can remove a discord bot from your server.

Frequently Asked Questions:

  • How To Make A Discord Bot
  • Best Discord Bots For Fun
  • How To Make A Bot On Discord
  • How To Set Up Bots In Discord
  • How To Remove A Bot From Discord

Final Words…

I hope you have now fully learned the process of creating and deploying a discord bot in your server. If you still have any questions or queries regarding how to make a discord bot, let me know in the comments section. I will try my best to get back to you ASAP and resolve your issue.

Don’t forget to share this article with your friends and family. Thanks for visiting!!

LEAVE A REPLY

Please enter your comment!
Please enter your name here