Icon Celebrity Journal
general /

How to make your own discord bot

Last Updated: September 6, 2019

This article was co-authored by our trained team of editors and researchers who validated it for accuracy and comprehensiveness. wikiHow’s Content Management Team carefully monitors the work from our editorial staff to ensure that each article is backed by trusted research and meets our high quality standards.

This article has been viewed 9,526 times.

Discord’s stream-hosting services offer a great platform for sharing or playing music, aided by their customizability with bots and plugins. This wikiHow shows you how to install a music bot on your Discord server.

How to make your own discord bot

How to make your own discord bot

How to make your own discord bot

How to make your own discord bot

How to make your own discord bot

How to make your own discord bot

Every day at wikiHow, we work hard to give you access to instructions and information that will help you live a better life, whether it’s keeping you safer, healthier, or improving your well-being. Amid the current public health and economic crises, when the world is shifting dramatically and we are all learning and adapting to changes in daily life, people need wikiHow more than ever. Your support helps wikiHow to create more in-depth illustrated articles and videos and to share our trusted brand of instructional content with millions of people all over the world. Please consider making a contribution to wikiHow today.

How to make your own discord bot

Discord has an excellent API for writing custom bots, and a very active bot community. Today we’ll take a look at how to get started making your own.

You will need a bit of programming knowledge to code a bot, so it isn’t for everyone, but luckily there are some modules for popular languages that make it very easy to do. We’ll be using the most popular one, discord.js.

Getting Started

Head over to Discord’s bot portal, and create a new application.

How to make your own discord bot

You’ll want to make a note of the Client ID and secret (which you should keep a secret, of course). However, this isn’t the bot, just the “Application.” You’ll have to add the bot under the “Bot” tab.

How to make your own discord bot

Make a note of this token as well, and keep it a secret. Do not, under any circumstances, commit this key to Github. Your bot will be hacked almost immediately.

Install Node.js and Get Coding

To run Javascript code outside of a webpage, you need Node. Download it, install it, and make sure it works in a terminal (or Command Prompt, as all of this should work on Windows systems). The default command is “node.”

We also recommend installing the nodemon tool. It’s a command line app that monitors your bot’s code and restarts automatically on changes. You can install it by running the following command:

You’ll need a text editor. You could just use notepad, but we recommend either Atom or VSC.

Here’s our “Hello World”:

How to make your own discord bot

This code is taken from the discord.js example. Let’s break it down.

  • The first two lines are to configure the client. Line one imports the module into an object called “Discord,” and line two initializes the client object.
  • The client.on(‘ready’) block will fire when the bot starts up. Here, it’s just configured to log its name to the terminal.
  • The client.on(‘message’) block will fire everytime a new message is posted to any channel. Of course, you’ll need to check the message content, and that’s what the if block does. If the message just says “ping,” then it will reply with “Pong!”
  • The last line logs in with the token from the bot portal. Obviously, the token in the screenshot here is fake. Don’t ever post your token on the internet.

Copy this code, paste in your token at the bottom, and save it as index.js in a dedicated folder.

How to Run the Bot

How to make your own discord bot

Head over to your terminal, and run the following command:

This starts up the script, and also fires up the Chrome debugger, which you can access by typing chrome://inspect/ into Chrome’s Omnibar and then opening “dedicated devtools for Node.”

Now, it should just say “Logged in as ,” but here I’ve added a line that will log all message objects received to the console:

How to make your own discord bot

So what makes up this message object? A lot of stuff, actually:

How to make your own discord bot

Most notably, you have the author info and the channel info, which you can access with msg.author and msg.channel. I recommend this method of logging objects to the Chrome Node devtools, and just looking around to see what makes it work. You may find something interesting. Here, for example, the bot logs its replies to the console, so the bot’s replies trigger client.on(‘message’) . So, I made a spambot:

How to make your own discord bot

Note: Be careful with this, as you don’t really want to deal with recursion.

How to Add the Bot to Your Server

How to make your own discord bot

This part is harder than it should be. You have to take this URL:

And replace CLIENTID with your bot’s client ID, found on the general information tab of the application page. Once this is done though, you can give the link to your friends to have them add the bot to their servers as well.

Alright, So What Else Can I Do?

How to make your own discord bot

Beyond basic setup, anything else is entirely up to you. But, this wouldn’t be much of a tutorial if we stopped at hello world, so let’s go over some of the documentation, so you have a better idea of what’s possible. I suggest you read through as much as you can, as it’s very well documented.

I would recommend adding console.log(client) to the start of your code, and taking a look at the client object in the console:

How to make your own discord bot

From here, you can learn a lot. Since you can add a bot to multiple servers at once, servers are part of the Guilds map object. In that object are the individual Guilds (which is the API’s name for “server”) and those guild objects have channel lists that contain all the info and lists of messages. The API is very deep, and may take a while to learn, but at least it’s easy to set up and get started learning.

How to make your own discord bot

Creating a custom Discord bot is a fun and engaging way to sustain the interest of your community server. When you invite your friends over to your channel, the bot will manage their interactions in your absence. For example, if a user is misbehaving, the bot can kick him or her out.

To do that, you have to acquaint yourself with some programming and steps to create your bot and add it to your server. The following guide simplifies what has to be done with easy-to-understand screenshots.

Creating Discord Bot on Developer Portal

Log in to your Discord account and go to the developer portal. Here, you can create a new bot “application.”

How to make your own discord bot

Give your application a desired name and click “Create.”

How to make your own discord bot

In the next step fill in some details regarding what this application is all about. You can choose an app icon. Remember to save the changes.

How to make your own discord bot

Now add a bot using the “build-a-bot” feature of the portal.

How to make your own discord bot

Give your consent to adding a bot to the app. The action is irrevocable.

How to make your own discord bot

After you complete the above steps, a wild bot is created. However, it is not ready to be shared yet. For that, you need to provide additional information.

How to make your own discord bot

Make a checklist of what your bot can do. You should not give it administrator privileges, as then it can control your server. Feel free to let it mute or ban members, prioritize speakers, add reactions, embed links, manage nicknames, and much more. Each level of permission provided by you has its own unique ID you can see on the dashboard itself.

How to make your own discord bot

Creating the Code for Your Discord Bot

If you are a programmer, you will want to modify the bot’s functions quite a bit. This demonstration uses node.js, a JavaScript runtime environment. Once installed for Windows, you may want to install “additional tools,” which can be done directly from the command terminal. It will install Chocolatey, Visual Studio, and other programs in Windows Powershell.

How to make your own discord bot

Download and install Node.js for Windows x64 and then run the following specific program from the Start menu. It’s a Node.js command prompt. (Don’t run the other Node.js application file, as it has a different use.)

How to make your own discord bot

Once the environment has been set up for using Node.js, you will have to install “discord.js with voice support” using the following code.

How to make your own discord bot

You should see a success status for the number of packages created.

How to make your own discord bot

Install nodemon as shown below.

How to make your own discord bot

Go back to your Discord bot on your developer portal webpage. Click the icon for “click to reveal token,” and it will display an alphanumeric key, which is your private Admin. Don’t share the token with anyone, as it is easily hackable.

How to make your own discord bot

Check the code example shown at the official Discord site.

Instead of a token in the last line of code, copy-paste your own Discord bot token.

How to make your own discord bot

Save the file as “Index.js” in any folder which is directly accessible from the Command prompt. It can have any name as long as it is a .js file.

How to make your own discord bot

Now, to run the bot, enter the following code.

When it’s ready, the Node.js will then log you into your Discord API. There is also an editor mode in Node.js which you can access from .help option. This is where you can introduce further edits to your bot.

How to make your own discord bot

Adding the Bot to Your Server

Once your bot has been created, you will want to add it to your Discord server. For that, you will need a link such as the following:

The “client ID” is found in General information under the Application where you have saved the bot.

How to make your own discord bot

In the below screen, you can see the client ID for the bot that was created in the first section.

How to make your own discord bot

Open a browser and enter the link shared above. Simply replace the client ID with yours. You can choose the server where you can add the bot.

How to make your own discord bot

If the bot is successfully created, you will see an “authorized” message which shows the app has been connected to your Discord server. If you have the Discord server installed for Windows, you should see an alert in the system tray as shown here.

How to make your own discord bot

The created bot has been successfully added to the Discord server.

How to make your own discord bot

Discord bots are an interactive means to build interest in your server. For more information on working with custom Discord bots, refer to this official manual.

Have you created your own Discord bot? What was its purpose? Please share your ideas in the comments.

Related:

Sayak Boral is a technology writer with over ten years of experience working in different industries including semiconductors, IoT, enterprise IT, telecommunications OSS/BSS, and network security. He has been writing for MakeTechEasier on a wide range of technical topics including Windows, Android, Internet, Hardware Guides, Browsers, Software Tools, and Product Reviews.

How to make your own discord bot

How To Make A Discord Bot: If you are into online gaming and have ever followed popular online gamers on platforms like Youtube or Twitch, then you must have heard about Discord. If you haven’t, Discord is a free and open-source communication platform for gamers which enables us to chat over messages and voice with multiple people at once.

One of the main features of Discord is discord bots, which are used by chat room creators to perform certain functions. Discord bots are automated tools that are designed to perform specific roles as programmed.

In fact, discord bots have become so popular in the last few years that new discord bots are being created regularly and also used by many. When it comes to discord, bots are one of the most essential parts of it. If you are fascinated by the term discord and are thinking about how to make a discord bot, then the answer is that it is fairly simple to design and very easy to use.

Creating a unique discord bot is easy, but if you want to download and use one which has already been created by someone, then you can go to the DiscordBots website and either develop your own or select from the list of already created ones.

Creating a discord bot is not difficult, but there are a few things that you should know and should be prepared to help you set up discord bots. The first thing that you need to do is to fill the prerequisites to create the bots. For that, you need to have a Notepad++ or a text editor software. Once you have it, make sure to have a Discord account and a Discord server to test the bot. Once you have all the three, you are ready to create a bot. A bot works as an automated robot that connects with your servers and accts in response to a specific event.

How to make your own discord bot

Creating a custom Discord bot is a fun and engaging way to sustain the interest of your community server. When you invite your friends over to your channel, the bot will manage their interactions in your absence. For example, if a user is misbehaving, the bot can kick him or her out.

To do that, you have to acquaint yourself with some programming and steps to create your bot and add it to your server. The following guide simplifies what has to be done with easy-to-understand screenshots.

Creating Discord Bot on Developer Portal

Log in to your Discord account and go to the developer portal. Here, you can create a new bot “application.”

How to make your own discord bot

Give your application a desired name and click “Create.”

How to make your own discord bot

In the next step fill in some details regarding what this application is all about. You can choose an app icon. Remember to save the changes.

How to make your own discord bot

Now add a bot using the “build-a-bot” feature of the portal.

How to make your own discord bot

Give your consent to adding a bot to the app. The action is irrevocable.

How to make your own discord bot

After you complete the above steps, a wild bot is created. However, it is not ready to be shared yet. For that, you need to provide additional information.

How to make your own discord bot

Make a checklist of what your bot can do. You should not give it administrator privileges, as then it can control your server. Feel free to let it mute or ban members, prioritize speakers, add reactions, embed links, manage nicknames, and much more. Each level of permission provided by you has its own unique ID you can see on the dashboard itself.

How to make your own discord bot

Creating the Code for Your Discord Bot

If you are a programmer, you will want to modify the bot’s functions quite a bit. This demonstration uses node.js, a JavaScript runtime environment. Once installed for Windows, you may want to install “additional tools,” which can be done directly from the command terminal. It will install Chocolatey, Visual Studio, and other programs in Windows Powershell.

How to make your own discord bot

Download and install Node.js for Windows x64 and then run the following specific program from the Start menu. It’s a Node.js command prompt. (Don’t run the other Node.js application file, as it has a different use.)

How to make your own discord bot

Once the environment has been set up for using Node.js, you will have to install “discord.js with voice support” using the following code.

How to make your own discord bot

You should see a success status for the number of packages created.

How to make your own discord bot

Install nodemon as shown below.

How to make your own discord bot

Go back to your Discord bot on your developer portal webpage. Click the icon for “click to reveal token,” and it will display an alphanumeric key, which is your private Admin. Don’t share the token with anyone, as it is easily hackable.

How to make your own discord bot

Check the code example shown at the official Discord site.

Instead of a token in the last line of code, copy-paste your own Discord bot token.

How to make your own discord bot

Save the file as “Index.js” in any folder which is directly accessible from the Command prompt. It can have any name as long as it is a .js file.

How to make your own discord bot

Now, to run the bot, enter the following code.

When it’s ready, the Node.js will then log you into your Discord API. There is also an editor mode in Node.js which you can access from .help option. This is where you can introduce further edits to your bot.

How to make your own discord bot

Adding the Bot to Your Server

Once your bot has been created, you will want to add it to your Discord server. For that, you will need a link such as the following:

The “client ID” is found in General information under the Application where you have saved the bot.

How to make your own discord bot

In the below screen, you can see the client ID for the bot that was created in the first section.

How to make your own discord bot

Open a browser and enter the link shared above. Simply replace the client ID with yours. You can choose the server where you can add the bot.

How to make your own discord bot

If the bot is successfully created, you will see an “authorized” message which shows the app has been connected to your Discord server. If you have the Discord server installed for Windows, you should see an alert in the system tray as shown here.

How to make your own discord bot

The created bot has been successfully added to the Discord server.

How to make your own discord bot

Discord bots are an interactive means to build interest in your server. For more information on working with custom Discord bots, refer to this official manual.

Have you created your own Discord bot? What was its purpose? Please share your ideas in the comments.

Related:

Sayak Boral is a technology writer with over ten years of experience working in different industries including semiconductors, IoT, enterprise IT, telecommunications OSS/BSS, and network security. He has been writing for MakeTechEasier on a wide range of technical topics including Windows, Android, Internet, Hardware Guides, Browsers, Software Tools, and Product Reviews.

How to make your own discord bot

Bots are part of what make Discord fun, but where do they come from? For the most part, bots are built by other Discord users. You can find a bunch of ready-to-install bots over at DiscordBots.org, or you can build your own. Here’s how to make a Discord bot.

How to Make a Discord Bot with Code

Interested in building a bot from scratch? You can, if you know how to write JavaScript. Thomas Lombart wrote a great Medium piece outlining the process, and I recommend you start there. To summarize, you need to:

Install the relevant dependencies on your computer

Write the code for your bot

Set up a Discord developer account

Give the bot the proper permissions

Troubleshoot your bot

Upload the bot to a server

Lombart’s tutorial outlines the whole process and shows you how to build a bot that can kick people out of the current room. You can check Discord’s documentation to learn all of the other things you can do. But the best way to learn is to dig in and start coding.

How to Make a Discord Bot Without Code

If you’re not a coder, we can help. Zapier can connect Discord with thousands of apps, allowing you to build bots that pull information from the rest of the web. You can get started right here if you know what you want to build.

Let’s start with a simple example. Imagine that you run a local Discord chat room and want to send a message to the group when it’s going to rain. Start building a Zap, then choose Weather by Zapier as the trigger app.

Next, select Will It Rain Today? as the trigger, then click Save and Continue.

You’ll be asked for your longitude and latitude and whether you’d like to use Celsius or Fahrenheit.

Click Continue, and move onto the second step. This is where you will use Discord.

Select Send Channel Message, then click Save + Continue.

You will be asked to connect your Discord account to Zapier, and you’ll select which server you want to add your bot to.

Once that’s done, you can set up your template. Choose which channel the post should go to, then customize your message.

You can pull in information from the trigger step by clicking the fields button, which opens a pull down menu.

Click anything in this menu to add that information to your message. Almost done! You can optionally enable text to speech, change the bot’s name, and give the bot a custom icon, before clicking Continue.

Now you’re ready to test your bot.

Click Send Test to Discord, and you should see a success message.

Congrats! You’ve set up a simple bot.

This is just one example, of course. You can build bots connecting any of the thousands of apps offered by Zapier. This is an easy way to send messages every time a new Twitch stream starts, for example.

Or, using the magic of RSS, you could announce new articles on any website, or even new podcast episodes.

Want to find more examples like this? Check out our Discord integrations.

Get productivity tips delivered straight to your inbox

We’ll email you 1/wk, and never share your information.

How to make your own discord bot

Justin Pot is a staff writer at Zapier based in Hillsboro, Oregon. He loves technology, people, and nature, not necessarily in that order. You can follow Justin: @jhpot. You don’t have to. But you can.

Related articles

How to make your own discord bot

Why I use Zapier to crosspost to multiple social media platforms

Why I use Zapier to crosspost to multiple.

How to make your own discord bot

How to automatically track Asana projects with Toggl’s time tracker

How to automatically track Asana projects.

How to make your own discord bot

How StoryCorps uses Zapier to enrich CRM data and improve internal workflows

How StoryCorps uses Zapier to enrich CRM.

How to make your own discord bot

7 ways to manage your electronic signatures, automatically

7 ways to manage your electronic signatures.

How to make your own discord bot

5 workflows to streamline your invoice and payment processes

5 workflows to streamline your invoice and.

3 Discord Bot Makers to Create Discord Bots Fast

Discord bots are amazing and can change the feel of a server. But, the development of such bots is expensive and can burn a hole in anyone’s pocket. This is why many users search the internet for a Discord bot maker.

There are a lot of apps that can help you in making bots. BotGhost and Glitch offer an online Discord bot development environment to the users. Bot designer Discord and Discord bot maker on Steam are two similar applications to create a bot.

Developers charge a hectic price for even coding a simple Discord bot. This scenario changed when do-it-yourself Discord bot makers entered the market.

Even people with a basic understanding of the computer can code and develop their own bots using these services. In this article, we will be sharing with you the 3 best bot makers to help you in creating a bot that suits your needs.

Why You Need a Discord Bot Maker

But first of all, why do we need a Discord bot maker when we have the developers around?

The answer is simple – Not everyone can afford to hire a developer for such tasks.

With Discord bot makers, you can easily develop your own bot and even customize them so that they work according to your wish and will.

Some of the bot makers provide hosting solutions as well so that you need not care about how to deploy your bot and manage it on the internet.

The 3 Best Discord Bot Makers

Coming straight to the point, it is time that we discuss the bot makers on our list. We will start with a computer software named Discord bot maker.

1. Discord Bot Maker on Steam

As their Steam page says, Discord Bot Maker is a powerful bot development tool for the #1 text and voice chat service for gamers: Discord. With this tool, you and your teammates can take your social experience to the next level!

The software just costs around 10 dollars and believe us, you won’t regret buying it at all. With the software, you will have the power and control to create bots that can do almost anything you want.

How to make your own discord bot

This software works on the mechanism of commands and events. That means, when something (an event) occurs, the bot will execute a command.

For example, when someone says a bad word, the Discord bot will warn them about the same.

2. BotGhost

BotGhost is another bot maker that provides online services to create a bot for Discord. The website also offers bot hosting that can take the burden off your head.

Around 275 thousand bots have been developed using BotGhost, this definitely means that the platform is decent and has all the features that you need.

The bots that you’ll develop using Botghost will provide you with full control over the commands and functionalities.

How to make your own discord bot

BotGhost has additional modules that you can add to your bot in order to make it more sophisticated and advanced.

If the process of choosing a hosting for your bot is confusing for you, then check out our list of the best Discord bot hosting platforms. We have mentioned both free and paid platforms on the list.

3. Bot Designer Discord

If you do not have any prior programming knowledge, then we will recommend that you should go for Bot Designer Discord.

It is a powerful app that can help you in making the Discord bot of your dreams. Whether it is a complex music bot or a simple bot that sends a specific sentence to a user, Bot Designer is there for all your needs.

How to make your own discord bot

However, this does not mean that programming practitioners should not use this service. The easy to use the command line is only for beginner. If you want, you can use Javascript for custom coding your Discord bot.

Bot Designer Discord provides hosting for your bot as well. As their site states, Just code your bot, we will take care of rest!

The app is available for both Android and iOS devices. You can download the application from their official website as well.

Final Words

So that was our take on the 3 best Discord bot makers to help you in creating the bot that suits your needs.

In this list, we mentioned a web-based service, a desktop application, and a smartphone application to code your Discord bot.

Discord bot maker is available on Steam for 10 dollars and contains everything that you need for developing a bot. BotGhost is an online platform and has a lot of features and modules for creating your own bot.

Bot Designer Discord is a mobile application that is perfect for anyone who doesn’t have any notable experience in the computer industry.

The easiest way to create a simple AI chatbot for beginners

How to make your own discord bot

Anass El Houd

Aug 19, 2020 · 5 min read

Working on projects is the most crucial stage in the learning path. In this step, you must be able to put all the skills and knowledge you learned theoretically into reality. And this becomes even more important when it comes to artificial intelligence or data science.

As I began to study this field more deeply, I realized that finding application projects is not a hard task. We barely use Artificial Intelligence in many areas. Thus, we can find many new and different applications related to other fields such as medicine, engineering, accounting, etc. Although the most difficult thing is knowing what are the exact steps to follow in order to accomplish this specific project.

In this article, I am going to share with you my personal experience in creating and building my own AI Chatbot on Discord.

How to make your own discord bot

For those who have never heard about Discord, it is a popular group-chatting app that was originally made to give gamers or geeks a place to build communities and talk [1]. What is interesting about Discord is the fact that it has a developer portal where you can do many fascinating things like deploying your own AI chatbot. Therefore, you need to sign up and join Discord Developer Portal from here.

Before we start the real work, let’s talk, first of all, about the steps I followed to build my AI Chatbot. In fact, this project is part of Natural Language Processing Applications. NLP or Natural Language Processing is a technology that allows machines to understand human language through artificial intelligence. Find out everything you need to know about it [2].

Now, we are ready. Let’s get started!

Your first task will be to choose what service you want your Chatbot to provide. Will it be just a simple Chatbot? Able to answer normal questions and talk on its own? Or you want it to help you in your daily work? Or maybe suggest some healthy meals each day. It seems great! Doesn’t it?
This first step lends a helping hand to know what specific data you must collect. If your Chatbot will answer general questions and be a normal talker, then you don’t need to feed it with specialized text data for example.

I mention here two ideas for inspiration:
– Healthy meals Chatbot: the chatbot suggests a meal based on your nutrition needs (proteins, fats, and carbohydrates). It must be linked with any food database so it can search for the best meal that fits perfectly your needs.
– Reminder Chatbot: It gives you an overview of your meetings and all the things that you have added to your agenda.

In this step, you can either collect text data that are available on data platforms or create your own data depending on what you want to make. There are many open datasets you can download and adapt to your project. You can check them from here.

If you want to create your own data, you better respect the following format so you can train your model using my main code without problems:

You can add as much as you want of tags as long as you respect the format. The AI Chatbot will commonly learn the patterns of all new sentences and associate them with the tags to get responses. We will explain how it does that in more detail in the next part.

The NLP pipeline we are following in this project is shown below:

How to make your own discord bot

How To Make A Discord Bot: If you are into online gaming and have ever followed popular online gamers on platforms like Youtube or Twitch, then you must have heard about Discord. If you haven’t, Discord is a free and open-source communication platform for gamers which enables us to chat over messages and voice with multiple people at once.

One of the main features of Discord is discord bots, which are used by chat room creators to perform certain functions. Discord bots are automated tools that are designed to perform specific roles as programmed.

In fact, discord bots have become so popular in the last few years that new discord bots are being created regularly and also used by many. When it comes to discord, bots are one of the most essential parts of it. If you are fascinated by the term discord and are thinking about how to make a discord bot, then the answer is that it is fairly simple to design and very easy to use.

Creating a unique discord bot is easy, but if you want to download and use one which has already been created by someone, then you can go to the DiscordBots website and either develop your own or select from the list of already created ones.

Creating a discord bot is not difficult, but there are a few things that you should know and should be prepared to help you set up discord bots. The first thing that you need to do is to fill the prerequisites to create the bots. For that, you need to have a Notepad++ or a text editor software. Once you have it, make sure to have a Discord account and a Discord server to test the bot. Once you have all the three, you are ready to create a bot. A bot works as an automated robot that connects with your servers and accts in response to a specific event.