Index:
UPDATED ✅ Do you want to create your own Discord Bot to manage an online community? ⭐ ENTER HERE ⭐ and Learn Everything FROM ZERO!
Do you dare to create your own bot on Discord?either Do you prefer to opt for one of the already worked? Whatever your choice, robots have turned this platform into a more fun medium. Best of all, they are at your fingertips.
If you want to know what it’s about you will need to first know how to create a bot from scratch and all the tasks that each program can perform.
But that’s not all you can read, too we will present you a list with the best Discord robots so you can choose the one that best suits you.
What knowledge do I need to have in order to create a Discord bot from scratch?
The first thing you should know is what a bot is so you can program one according to your needs. A boat is a software, usually small, which performs automatic tasks on a given platform, in this case on Discord. Therefore, you can create a custom software to execute any action you want, for example, greeting a new member of a chat.
Luckily you don’t have to be an expert to create a robot on Discordyou will only need to know some basic concepts of programming languages, especially javascript. This will help you achieve the complexity you want, but you must bear in mind that if you create a multitasking bot you must have a little more advanced programming knowledge.
An aspect that you must take into account when launching on creating a Discord bot from scratch is that the platform itself provides the necessary help to guide you in each step of the programming. From this base it is possible to insert arguments, prefix and commands. Do not forget that the company encourages users to generation of new bots to be used among its members.
What tasks can I have my Discord bot perform?
once you know that is it possible to make a bot from scratch on Discord According to your programming knowledge and with the help you receive from different functions, it is important that you know what kind of tasks a robot can perform on this platform.
Among the most common and frequent actions that users choose for a bot to perform on Discord are:
- To create Y Send Greetings.
- Compose messages of farewells within a channel.
- Show new members the rules Y beginning of a chat.
- give answers to frequently asked questions.
- Promote events.
- To offer reminders.
- play music.
- Insert Gifs, videos and photos.
- Receive alerts of Twitter Y Youtube.
- Play video games with anime characters.
- Watch films.
As you may have seen, the possibilities are diverse within what is expected of an instant messaging platform. Of course, the greater the functions of the robot, the more complexity the level of programming requires, which we will explain below.
Learn step by step how to create your own Discord bot from scratch without errors
Pay attention to the step by step that you must follow to create your own Discord bot from scratch without making mistakes:
Create an account
The first thing you should do is register on the platform to be able to program a robot that executes the functions you need. For this you must enter with your browser trusted and write the URL https://discord.com/
. You will then be able to download the application to your computer and open instant messaging from your browser. You are going to do this by pressing Download for Windows (MacOS, if you use this operating system) or Open Discord in your browser.
If you choose the first button a program will be installed on your PC, so you will have to follow the installation steps of any software. Instead, if you select the second option you will have to choose a username and write an email. After this You will receive an email to the email address you chose to confirm the veracity of your account. Once you are done with these steps you are ready to use Discord.
choose a server
Already inside the account add a server. You can do this by clicking on the + symbol located on the left bar of the screen. Next, you’ll need to choose whether you want to create your own squad or join a server because you already have an invite.
Give it a name, create channels and customize it to your liking. This server is the place where your robot will be hosted. Therefore pay close attention to his name, as you will need it later. Above all, if you have more than one server in your charge. Don’t forget that the server is where you meet up with your friends to chat.
Download a code editor
What you will need now is to download a text editor that will help you in programming. It is possible to use Visual Studio Code, Notepad++ and Atomamong others, but of these options the most used is Notepad++ for Windows. So we will work with this free source code editor. To do this you will have to go to your browser and write in the address bar https://notepad-plus-plus.org/
.
Then you have to press the button Discharge located at the top left of the screen. Continue with the installation steps choosing the version that you like the most. If you want you can use Visual Studio Code, since this compiler is the one recommended by the platform. Another program that creates a runtime environment for JavaScript that you must have is Node.js. you will be able to download and install according to the specifications of your OS and computer. This development is also Open Source and free to use.
Enter the Discord developer portal
go to the homepage of the platform and in the lower menu (below Means) select the option developers. Now you will have to select the option Applications to enter the portal developers. Your old apps will appear there, if you already have them. Another way you have is to open your account and write the URL https://discord.com/developers/applications
.
Create an application within the portal
once in the section developers go to the tab Applications, located in the top menu. Among the options you must choose To create. This box contains a symbol + inside so you can configure and customize your bot.
One of the first steps you will need to do at this stage is to go to Information general to place the name and photo that will identify your robot. In the box Description it is possible to insert a brief explanation of the tasks that the bot executes. Fill in all the necessary information and before moving on to the other settings, click the bottom right button Save Changes to save the changes.
Go to the Bot menu
Under Settingsin the left column of the screen, you will find the menu bot, which you must choose. After this, you will have to click on the Add Bot to add a new robot to your Discord.
Confirm the permissions and other settings to continue. You must take into account that you can choose if your robot will be in the public domain or if you only want it for your servers. Once this process is done, you will achieve a token authorization from Discord. Only following these steps the platform will recognize the code and let you add it to the servers. To finish this stage, among the permissions that appear at the bottom, select Administrator and save the changes.
Enter the permit calculator
Open a new tab with the URL https://discordapi.com/permissions.html
and determines the general, text and voice permissions that the bot will be able to execute. Choose the ones you want or, if you prefer, mark them all. Go to the bottom of the screen and enter the Client ID. You can get this 18 number pin in the menu Applications, then you must select Settings and, finally, general information. Click the button Copy and paste it in the lower field that bears the same name.
This will generate a link that will help you invite the bot. Click on that link and you will be automatically redirected to the invitation page. Remember that to activate permissions of orange color you have to have the authorization in 2 steps of Discord. The code will look something like this https://discordapp.com/oauth2/authorize?&client_id=CLIENTID&scope=bot&permissions=8
where id=CLIENTID
will be replaced by id=[tu verdadero número de cliente]
.
Invite the robot to the server
On the invitation page you will see a box with the name of the app and profile avatar that you just created. Below this you have to choose the server you want your bot to be hosted on. From the list, choose the one that interests you the most and click on Authorize. Get over the capcha now and in this way it will already be authorized by Discord your first Bot.
Get the authorization token
Look in the same “Bot” section for the box “App Bot User”. Choose the option Click to reveal token. This will give you a string of code that you must save and protect because it is a personal authorization and you will need it later. Remember that if someone knows this code they will be able to control your robot, so it will be convenient for you to obtain a new one by clicking on the tool regenerate.
Set up your computer desktop
What you have to do now is create a new folder on the desktop of your PC giving it a name that refers to your bot. For example, IPAPBOT. Open the folder and copy the exact address or path that appears above in the explorer. The next thing is to open the console, CDM or terminal of the code editor you just installed.
Create the necessary files in your new folder
Inside the console you place the command cd followed by a space _. Open quotes (“) and insert the path of the folder you just copied. Close with quotes and press Enter. Then put a space _ type npm and hit Enter. If you now open your folder you will see that a file has been generated to save all the robot packages.
The first file should have the following codes:
{ “Token”: “Número de token de bot” // Es el token que acabas de crear. }
To save this file do it with the name auth.json.
The second file should contain:
{ “name”: “greeter-bot”, “version”: “1.0.0”, “description”: “El bot de IPAP en Discord”, “main”: “bot.js”, “author”: “Internet Paso a Paso”, “dependencies”: {} }
You will save this file with the name package.json.
Configure the behavior of the robot
In this case you will have to create a third file that will be used to carry out all the actions what you want the Discord bot to do.
Here’s a simple JavaScript demo:
var Discord = require(‘discord.io’); var logger = require(‘winston’); var auth = require(‘./auth.json’); // realiza las configuraciones necesarias remove(logger.transports.Console); add(new logger.transports.Console, { colorize: true }); level = ‘debug’; // Initialize Discord Bot var bot = new Discord.Client({ token: auth.token, autorun: true }); on(‘ready’, function (evt) { info(‘Connected’); info(‘Logged in as: ‘); info(bot.username + ‘ – (‘ + bot.id + ‘)’); }); on(‘message’, function (user, userID, channelID, message, evt) { // El bot necesita saber si ejecutará alguna acción // o trabajará cuando escuché los mensajes que comiencen con la exclamación ´¡´ if (message.substring(0, 1) == ‘¡’) { var args = message.substring(1).split(‘ ‘); var cmd = args[0]; args = args.splice(1); switch(cmd) { // !ping case ‘ping’: sendMessage({ to: channelID, message: ‘“¡Hola! ¿Cómo estás? ¡Bienvenido al curso de Discord de Internet Paso a Paso!’ }); break; // ingresa el comando que desees } } });
This way you will make any user who starts typing with the character “¡” will make the bot respond “Hello! How are you? Welcome to the Internet Discord Step by Step course!”. Another project you can try is the one shown below. this bot can intervene in messages by handling various commands from a userwhich is related to the Discord API.
First you must create the configuration file and install the dependency, for this you must use these codes:
mkdir discord-bot // para crear una carpeta cd discord-bot // con esto hará que puedes dirigirte a la carpeta creada nano config.json // crea el archivo config.json para lograr que el token sea autorizado { "BOT_TOKEN": “Número de token de bot” } npm init // con esto podrás cuidar el archivo package.json npm install discord.js // este código te servirá para interactuar con Discord Lo que deberás hacer ahora es crear el bot usando estos códigos: const Discord = require("discord.js"); const config = require("./config.json"); ... const client = new Discord.Client(); login(config.BOT_TOKEN); // guarda y cierra el archivo
Continue with the index.js file:
node index.js // esto te servirá para terminar de configurar el entorno de codificación.
Next, write these codes to command the bot:
nano index.js ... const client = new Discord.Client(); on("message", function(message) { }); login(config.BOT_TOKEN); ... on("message", function(message) { if (message.author.bot) return; });
At this point you will need to write a command handler:
const prefix = "!"; on("message", function(message) { if (message.author.bot) return; if (!message.content.startsWith(prefix)) return; }); ... on("message", function(message) { if (message.author.bot) return; if (!message.content.startsWith(prefix)) return; const commandBody = message.content.slice(prefix.length); const args = commandBody.split(' '); const command = args.shift().toLowerCase(); }); ... const args = commandBody.split(' '); const command = args.shift().toLowerCase(); if (command === "ping") { } }); ... if (command === "ping") { const timeTaken = Date.now() - message.createdTimestamp; reply(`Pong! This message had a latency of ${timeTaken}ms.`); } ...
So far you have created a bot that works with the ping command, with which you will be able to send and view messages in any channel in which the robot has access. What you need to do now is implement it via sum.
The steps are:
nano index.js ... if (command === "ping") { const timeTaken = Date.now() - message.createdTimestamp; reply(`Ping! La latencia es ${timeTaken}ms.`); } else if (command === "sum") { } }); ... else if (command === "sum") { const numArgs = args.map(x => parseFloat(x)); const sum = numArgs.reduce((counter, x) => counter += x); reply(`La cantidad de todos los argumentos es ${sum}!`); } ... node index.js const Discord = require("discord.js"); const config = require("./config.json"); const client = new Discord.Client(); const prefix = "!"; on("message", function(message) { if (message.author.bot) return; if (!message.content.startsWith(prefix)) return; const commandBody = message.content.slice(prefix.length); const args = commandBody.split(' '); const command = args.shift().toLowerCase(); if (command === "ping") { const timeTaken = Date.now() - message.createdTimestamp; reply(`Pong! La latencia es ${timeTaken}ms.`); } else if (command === "sum") { const numArgs = args.map(x => parseFloat(x)); const sum = numArgs.reduce((counter, x) => counter += x); reply(`La cantidad de todos los argumentos es ${sum}!`); } }); login(config.BOT_TOKEN);
With the Visual Studio Code editor you can also work in this way, in the top menu go to File, Archive, open folder and choose the folder where you just created on the desktop with the three files. Next, type a name for the new file, for example “server.js”. In the bottom section choose Scheme and then Terminal. There take advantage and install npm install discord.js.
Then write these codes:
const Discord = require("discord.js"); const client = new Discord.Client(); on('ready', () => { log(`¡Empecemos!`); }); on('message', (message) => { if(message.content.startsWith('ping')) { channel.send(`pong!!`); } }); login('Token obtenido');
Use the command prompt
Is windows function It will allow you to finish completing the setup of the Discord app on your computer. To do this you must click on the start button and write the name of the tool, then a list will appear with all the available applications, so you will have to choose Command Prompt. To finish, click on Execute as an administrator.
Choose the folder path of your files
What you have to do now is write in the Symbol of the system the path that has the folder you have created. For example: “cd UsersIPAP DesktopDesktopDiscordBot”.
Install the bot plugins
In this step you must enter:
npm install discord.io winston –save npm install https://github.com/woor/discord.io/tarball/gateway_v6
Run the bot by typing nodebot.js.
List of the best Discord bots that you can use in your communities and groups
Take a look at the best Discord bots you can use in your groups:
Yagpdb.xyz
With this bot you will have a very versatile multipurpose helper. Its features range from executing moderation rules to displaying server statistics. From their official website they claim to have more than 1,725,106 united servers and more than 200,000 executions of their commands.
But this is not all, provide helpful guides to get the most out of it. Thanks to it you can adjust welcome messages, give answers automated or get message logs. A fun aspect of this robot is that it has more than 200 fun facts about cats.
FredBoat
It is a music-oriented complement that you can download from https://bots.ondiscord.xyz/bots/184405311681986560.
Like groovy either FredBoat allows you to play songs from hundreds of platforms such as Youtube, Spotify or the popular platform Twitch. It is very good at supporting playlists.
Also, According to the role that the participant has, he can select a specific playlist. It emerges as a bot specialized in music for voice channels. For this reason it is more advantageous than simply have linked Spotify to Discord or other apps.
look
It has a purpose similar to Yagpdb because manages to automate many management tasks. These include registering events, giving informative commands and also deleting or assigning roles. It is somewhat more limited than the mentioned bot, so its basic actions are easier to learn.
It has tools designed for the community with useful services when you want to propose a voting system or run daily messages. With this bot it is possible to take advantage of Google extensions (especially the music player and the reminders it offers). You will be able to download it in https://mirai.brussell.me/
.
PatchBot.io
If you’re gamer and fan of Dota 2, Fortnite, Apex Legends, World of Warcraft and other popular titles you must have this bot on your Discord. It is designed to provide data on game patches and updates. You will also be able to participate in community of the newest topics about anime games.
suggester
If you are one of those people who have a huge server in charge, then Suggester will help you to compile all the information. It is appropriate when you keep track of a company or even a group of gamers. By typing a few simple commands, it will reveal to you what the roles of each member are and who is playing or interacting. You will be able to download this bot and link it to Discord entering the URL https://suggester.js.org/#/
and then you’re going to have to choose the button Start.
Software