![]() For this example, we’ll use Dyno, but the instructions may vary if you’re adding another Bot. It’s important to note that depending on your Bots’ source website, you may see Invite or Add Bots. ![]() Scroll down to the Advanced Permissions setting and toggle Administrator on.Once Selected, choose the drop-down menu (the server name in the top left-hand of the screen with a small down arrow next to it).From your Discord home page, select the server you’d like to add the bot to (on the left-hand side of the Discord Website). ![]() If you don’t own the server, it’s probably a good idea to check with the owner before adding anything to it. ![]() To add bots to your Discord Server, you will have to be an Administrator of that server. Once you get the hang of it, it’s actually quite simple. We can type "meme" and the bot will fetch a meme from an API and send us a random meme!įor best practice, bot commands usually start with an exclamation mark so let's make it "!meme" instead to instruct the bot for a meme.įor the API, we can use this simple one by jaychandra6.Adding Bots to your Discord server can be a lengthy process the first time around. Step 6: Writing your first bot commandĪ bot that just replies "Pong!" whenever you type ping is not very useful, isn't it? Let's take it up a notch by asking the bot for an image. Great, now if we run the command below, our bot should go online: node index.js Remember the token we copied in Step 1? Create an. Import the discord.js package and create a new client like so: require('dotenv').config() //initialize dotenvĬonst Discord = require('discord.js') //import discord.jsĬonst client = new Discord.Client() //create new clientĬonsole.log(`Logged in as $!`) Ĭlient.login(_TOKEN) //login bot using token The first thing we need to do to code our discord bot is to create a discord bot client and log our bot in. If you see the bot installed in your server, it is currently offline. This will create an index.js file, where our bot functions will be written at. ![]() In our project directory, run: touch index.js ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |