> For the complete documentation index, see [llms.txt](https://bothosting-net.gitbook.io/bot-hosting.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bothosting-net.gitbook.io/bot-hosting.net/create-bot/discord-bot.md).

# How to Create a Discord Bot

{% hint style="info" %}
Discord Bots are created in the Discord Developers Portal.

Running user accounts instead of bots is against Discord Terms of Service and gets your account banned.
{% endhint %}

#### **Step 1: Learn a Programming Language** <a href="#ys46es5t60k" id="ys46es5t60k"></a>

Creating a Discord Application (bot) requires code for it to start and run features you program it to execute. It is not enough to have a discord bot token to run an application.

Before you start thinking about your bot, you need to know how to program. Do not focus on bot-related topics yet. Focus on learning a language first.\
Which language should you start with? That is your choice, although most beginners start with Python or JavaScript.

* **`Python:`** <https://www.codecademy.com/learn/python>
* **`JavaScript:`** <https://www.codecademy.com/learn/javascript>

> A well-known server that helps with programming language questions and development issues is The Coding Den: <https://discord.com/invite/code>

#### **Step 2: Learn to use a Library** <a href="#id-32287a6pb5y" id="id-32287a6pb5y"></a>

Once *you know how to program*, check out the Discord API server. If you do not know how to code yet, go back to Step 1. Then find a channel for the language you know. Note that this server will not teach you how to code. For questions unrelated to the library, see The Coding Den linked in Step 1.

`Library Comparison:` <https://discordapi.com/unofficial/comparison.html>\
`Discord API:` <https://discord.com/invite/discord-api>

#### **Step 3: Design Features** <a href="#id-70e22bskt83" id="id-70e22bskt83"></a>

So, your bot is running. Fantastic. But what should it do? Start simple. Make a command that responds with "pong" when a user types "ping". Work your way up from there by adding complexity and unique features. Add whatever you like, but make sure to follow the practices linked above. If you need ideas, try joining development servers for larger bots. You can often see which features people request and build your bot to fill those needs.

Do you prefer starting with pre made bases insted? Check out [Useful Repositories](/bot-hosting.net/create-bot/useful-repos.md)

#### **Step 4: Host the Bot** <a href="#fxffzw60x24" id="fxffzw60x24"></a>

bot-hosting.net is a free 24/7 service that lets you host your bots. You can find all the information you need to create a server in this website and set it up on this site.\
`Please note:` The Discord server is only for help with Step 4. We cannot and will not help with coding-related issues or requests.

{% hint style="warning" %}
Please keep in mind that this guide is unrelated to bot-hosting.net, and you will not get help with your code or libraries.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://bothosting-net.gitbook.io/bot-hosting.net/create-bot/discord-bot.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
