Ideally you should have a server OS installed on your computer Windows Server, Ubuntu Server, or macOS server. You can also host your bot on Azure, AWS, or Google Cloud.

Type in the application’s name and click “Create. ” You’ll want to create a name that is descriptive, like “Greeterbot” if your app bot greets people. However, “Greeterbot” will most likely trigger errors later on because it’s a popular name, so add a series of numbers after the name, like “Greeterbot38764165441. "

Click “Yes, do it!” in the pop-up to confirm your action. If you get an error about the name being too popular, go to the application page and change the app name. For example, “Music Bot” was too popular, so adding a few numbers to the end of the app helped.

Click “Copy” to copy all that text. You can paste it on a sticky note somewhere, but make sure you have access to that code and don’t give it out to anyone. Whoever has that code can control the bot. This code will always be here if you need it.

For example, if your ClientID was 000000000000000001, your URL would look like this: https://discord. com/oauth2/authorize?&client_id=000000000000000001&scope=bot&permissions=8

Click the drop-down box to display all your compatible channels. Click “Authorize” to continue. You’ll get a confirmation that the bot was moved and that you can close the active tab.

This code was provided by https://www. digitaltrends. com/gaming/how-to-make-a-discord-bot/. You can search the internet for bot codes you want, like ones that play music constantly. This wikiHow uses a code sample for a bot that responds to any text starting with “!”

{ “token”: “Your Bot Token” } Make sure you enter that Bot Token number you got from the previous steps between the quotation marks in the text.

{ “name”: “greeter-bot”, “version”: “1. 0. 0”, “description”: “My First Discord Bot”, “main”: “bot. js”, “author”: “Your Name”, “dependencies”: {} } Make sure you replace “author” name with your name. You can also change the “description” if you don’t like “My first discord bot. ”

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: ‘Pong!’ }); break; // Just add any case commands if you want to. } } });

You can close your text editor.

You now have code for your bot and will test that your code works in the next part.

Node. js installed correctly. The Bot Token is entered correctly in your auth. json file. You’re in the same channel as the bot. The bot is on the server. Your coding is correct in your auth. json, bot. js, and package. json files. You downloaded all the dependencies for your bot to work using Command Prompt with Node. js installed.