Under SCOPES, select bot. Finally, click on Copy. Open a new tab and paste in the URL the one you’ve just copied. Select your server and click on Authorize. Your bot is added! Go in the Discord app and check for your bot in the list of users. Give life to your bot. Our bot is on our server but it’s offline. So let’s make it alive.
- .voice game -This command is used to change the channel name to the current game being played by the owner of the channel.
- .voice invite @user - Using this command invites the said user to your channel with a direct link to the channel.
- .voice permit/reject @role - You can now permit/reject a certain role from accessing your channel
- .voice ghost/unghost - Make your channel invisible allowing you to hide from others so you can speak in private.
- Automatic bitrate - The channels are automatically created with the best bitrate possible.
- Better uptime - We will be monitoring the bot all the time and it is running on a better server.
- Premium support - VM+ gets higher priority with any issues caused with the bots(if any).
Oct 09, 2019 In this Discord bot tutorial, we will start by discussing the Discord user interface and step by step tutorial on how to make a Discord bot. Discord is a real-time messaging platform that bills itself as the “universal voice and text chat for gamers” because of its treatment interface, ease of use, and wide range of features, Discord has grown rapidly and is increasingly popular even. The Raid-Helper bot is a feature-rich event organization tool for discord. Create events inside discord and let your server members join with a simple click on a reaction! The members name will be added to the message and that way you can keep track of all Sign-Ups. Discord Bot maker is a application which allows you to build bots without having to use a huge amount of code. This bot building software is aimed at less experienced users who want a bot which they can customise without the flashy features. Discord Bot Maker is powerful, yet flexible, tool that allows both experienced programmers and bot newcomers to construct outstandingly effective bots in a matter of seconds. By piecing together actions that may occur through commands or events, one may create the bot of their dreams!
Discord has an excellent API for writing custom robots, and a very active bot community. Today, we will see how to start creating yours.
You will need a little programming knowledge to code a bot, so it's not for everyone, but fortunately there are modules for popular languages that make it easy. We will use the most popular, discord.js.
RELATED:How to create, configure and manage your Discord server
To start
See you on Discord's bot portaland create a new application.
You want to note the client ID and the secret (which you must keep secret of course). However, it is not the bot, but the application. You must add the bot under the Bot tab.
Also note this token and keep it secret. Do not put this key in Github. Your bot will be hacked almost immediately.
Install Node.js and get the coding
To execute Javascript code outside of a web page, you need to Node. Download it, install it and make sure it works in a terminal (or prompt, because all of this should work on Windows systems). The default command is 'node'.
We also recommend installing the nodemon tool. It is a command-line application that monitors your bot's code and restarts automatically when making changes. You can install it by running the following command:
npm i -g nodemon
You will need a text editor. You can just use the notebook, but we recommend either Atom or VSC.
Here is our 'Hello World':
const Discord = require (& # 39; discord.js & # 39;);
client const = new Discord.Client ();
client.on ('ready', () => {
console.log (`Connected as $ {client.user.tag}!`);
})
client.on (& # 39; message, msg => {
if (msg.content & # 39; ping & # 39;) {
msg.reply (& # 39; pong & # 39;)
}
})
client.login (& # 39; token & # 39;);
This code is taken from discord.js Example. Let's break it.
The first two lines are used to configure the client. The first line imports the module into an object called 'Discord', and the second line initializes the client object.
The client.on ('ready') block is triggered when the bot starts. Here he is just configured to register his name on the terminal.
The client.on (& # 39;) block is triggered each time a new message is posted on a channel. Of course, you have to check the contents of the message, and that's what the if block does. If the message simply says 'ping', it will respond with 'Pong!'
The last line connects with the bot portal token. Obviously, the token in the screenshot is wrong. Never post your token on the Internet.
Copy this code, paste your token at the bottom and save it as index.js in a dedicated folder.
How to run the bot
Go to your device and run the following command:
nodemon –inspect index.js
This starts the script and also triggers the Chrome debugger, which you can access by typing chrome: // inspect / in Chrome Omnibar, and then opening 'dedicated devtools for Node'.
Discord Developer Portal
Now, just say 'Connected as But here I've added a line that will record all the message objects received on the console:
Bot Maker Discord Online
So, what constitutes this message object? Many things, in fact:
Specifically, you have author and channel information that you can access with msg.author and msg.channel. I recommend this method of logging objects on Chrome Node devtools, and I'm just trying to see what works. You can find something interesting. Here, for example, the bot records its responses on the console, so the bot's responses trigger client.on ('message'). So, I did a spambot:
Note: Be careful with this because you do not really want to deal with recursion.
How to add the bot to your server
This part is harder than it should be. You must take this URL:
https://discordapp.com/oauth2/authorize?client_id=CLIENTID&scope=bot
Discord Bot Maker Commands
And replace CLIENTID by the client ID of your bot, available in the General Information tab of the application page. Once done, you can give the link to your friends so that they also add it to their servers.
Okay, so what can I do?
Beyond the basic configuration, everything else depends entirely on you. But it would not really be a tutorial if we stopped at Hello World, so let's go over some of the Documentationso you have a better idea of what is possible. I suggest you read as much as you can, as this is very well documented.
I recommend adding console.log (client) at the beginning of your code and look at the client object in the console:
From here you can learn a lot. As you can add a bot to multiple servers at once, the servers are part of the Guilds map object. In this object are the individual Guilds (which is the name of the API for 'server') and these guild objects have channel lists containing all information and message lists. The API is very deep and may take some time to learn, but at least it is easy to set up and learn.