How to make a Discord bot

DMCA / Correction Notice
- Advertisement -


Over the past five or so years, Discord has consistently shown that it’s an instant messaging platform not only for gamers but for anyone looking to message, video chat, or stream with friends online. Among the reasons are Discord bots. Bots can help you with everything from automating mundane tasks to starting playing music on your server, and in this tutorial, we’re going to show you how to make a Discord bot.

- Advertisement -

Difficulty

liberal




advertisement

Period

30 minute

- Advertisement -

Although automation is the main reason for using a Discord bot, you can program to do really anything (anything you can cram into some JavaScript code, at least). You don’t even need any programming knowledge to get started. Our guide will get you started building your own Discord bot, even if you’ve never touched a line of code before.

how to make a discord bot

Phase 1: Download Node.js and set up a Discord account.

Node.js is a JavaScript runtime that is free and open source, and you will really need it for your bot to work. download it from here nodejs.org And before you start anything else, install it.

Obviously, you’ll also need a Discord account and your own server to use to test your bot. If you haven’t yet, go here Discord.com and create one. If you have one, log in to your account and open the server you want your bot to reside on.

You’ll also need a text editor program, such as notepad++ On Windows, to code.

Phase 2: Now you need to create an application on Discord for your bot to work. It takes a little work, but it’s not too complicated. The goal here is to obtain an authorization token for the bot so that Discord can recognize your code and add it to the bot on their servers.

First, to head discordapp.com/developers/applications/me, Your account must be logged in, so you will go directly to your account’s application list. Kill new application to start. Give the bot a name, then press the button marked save Changes,

Now, on the right hand menu, click bot, Once in the new menu, click add bot Down build-a-boat the option. If you only have one application – the one we just created – it should appear automatically. Otherwise, select it.

step 3: in the marked box app bot userssearch for words Token: Click to reveal, Click on that link and you’ll reveal a string of text. This is your bot’s authorization token, which allows you to send codes to it. don’t share it with anyone – That token allows to code for the bot, which means whoever has it can control your bot. If you think the token has been tampered with, the good news is that you can easily generate a new token. generate a new token Button. Mark your token. You’ll need it in just a second.

step 4: Now scroll down to the box marked App Description and find your Client ID, a large number. Copy the number in place of the word CLIENTID and add it to this URL.

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

The final URL should look like this, but instead of this fake it should contain your client ID number: https://discordapp.com/oauth2/authorize?&client_id=000000000000000001&scope=bot&permissions=8

Copy the URL containing your Client ID number into your browser. This will take you to a website where you can tell Discord where to send your bot. You’ll know it’s done if you open Discord in an app or your browser and navigate to their server. The channel will say that a bot has joined the room, and you will see it on the menu on the right under the online members list.

Step 5: While you’re doing that, you can also take a moment to create a folder in an easy-to-access location on your computer where you can store all of your bot’s files. Call it something simple, like “DiscordBot” or “MyBot”, so you know exactly what it is.

Step 6: You are going to create three files for your bot with your text editor. First paste this code:

,

“token”: “Your bot token”

,

Replace “Your bot token” with the token you generated earlier on your bot’s application page. Make sure the token is in…

- Advertisement -

Stay on top - Get the daily news in your inbox

Recent Articles

Related Stories