Discord Logo by Discord

Discord Bots with Javacord: Creating a Discord Developer Application

Caleb Garcia
Java Playground
Published in
4 min readAug 6, 2020

--

In my last article, Setting up IntelliJ, I spoke on the IntelliJ IDEA, a little bit about what it can do, and how to get it on your computer so you have the resources necessary to create your Discord bot. In this article, I’ll be answering the next question I left you with at the end of the previous installment: What in the world is a Discord bot application and why do I need one?

What is an application?

A Discord developer application is something a developer can create to communicate with the Discord API; whether it be for creating a bot or a Rich Presence-enabled game, there are quite a few ways to use applications. Creating a developer application is very simple, but first, you should familiarize yourself with the Discord Developer Portal made for developers like you.

What is the Developer Portal?

On this page, you can create developer applications, join and view developer teams, and you even have access to the various sections of Discord’s documentation. For our Discord bot project, we’re mainly interested in the “create developer applications” section of the developer portal.

How do I create the application?

Creating your application is as simple as following these few steps: Go to the Developer Portal and navigate to the Applications tab. Click “New Application” in the corner, type in the name of your bot project (“MyFirstBot” for me), and click Create. Ta-da, you’ve made your Discord bot’s application!

What’s this thing called a Client ID in my application?

The Client ID is, simply, a string of numbers that is put into the bot’s invite link. When you replace the appropriate section of the link below with your application’s Client ID, you can use that link to invite the bot to any server you are an administrator of. You can also send this link to anybody else to do the same thing, and this is how your bot will get around Discord!

https://discord.com/oauth2/authorize?client_id=<clientidhere>&scope=bot

This is all great, but why do we need to do all of this in the first place?

The Discord bot sits in the applications we create from the Developer Portal; the code we write afterward is what can be considered the bot itself. When you go to the bot’s application page and navigate to the Bot tab, you have the option to add a bot to the application. Simply put, this brings the bot into existence and allows you to change and access some very pertinent information including changing the name, profile picture, and permissions, and having access to what’s called the bot’s “token”.

The token is a string of essentially random letters, numbers, and symbols that act as a password for our code to log in to the bot and tell it what to do. If anybody else has access to your bot’s token, they can make it do whatever they want, so it’s important that you don’t share it with anybody. Keep it secret, and keep it at the ready for the next article, where we’ll start the coding process to give you Discord bot life.

What can I do with a bot anyway?

To start thinking about what you want your bot to do and how to code it, you should know some of the reasons you would even want to make one in the first place. Discord bots are a very good way to do any number of things, such as:

  • Welcoming new members with a friendly and informational message,
  • Assigning and removing roles from users,
  • Create complex games and features that anybody in the world can play with on their servers,
  • Play music in a voice channel,
  • And much, much more!

I, personally, have created a bot that manages users’ roles for the Art Prompts Discord server, a bot that fetches random words from the English language, and another one that gets random facts about numbers. There are countless ways to program a Discord bot and what it does is all up to your imagination. I have a very simple but funny idea that I would like to showcase later on, and later installments in the series will be exactly that; showcasing ideas I’ve had, or suggestions you may have for bots to write and explain.

Now that you’ve created the application for your bot, you’ve completed the very last step before you can code your bot to do whatever you want! In the next article I’ll cover the basics of Javacord, the Java library we’ll use to create our bots, some basic bot functionality, and a few tips and tricks to making your bot the most awesome it could possibly be. If you sign up for The Playground Digest newsletter, you’ll be the first to get pointers on how to work with your bot’s backend.

Make sure to follow me to see more articles like this one, and much more in the future! If you know anybody who needs a quick rundown on what a Discord developer application is and how to make one, show them this article to give them the information they need!

If you’d like to support me, I can create one of these awesome Discord bots for your server through my Fiverr®️ Gig®️. Check it out, and shoot me a message if you’d like me to make one for you!

--

--

Caleb Garcia
Java Playground

Hello! My name is Caleb Garcia and I’m a programmer who would love to give you some of his coding experience, so you can make better decisions in your projects.