# What is a Discord bot?

> A Discord bot is an automated account that runs code to respond to commands and events. Learn how bots work, what they do and how they differ from users.

URL: https://www.jalkarna.in/based/learn/what-is-a-discord-bot/  
Last updated: 2026-11-16

A Discord bot is an automated account, controlled by a program instead of a person, that can read events in a server and respond to them. Bots can play music, moderate chat, greet new members, run giveaways or hold AI conversations. They show a "BOT" tag next to their name so members can tell them apart from people.

## How does a Discord bot work?

A bot is a program running on a server somewhere, not inside Discord itself. It connects to Discord in two ways:

- **The Gateway**, a persistent WebSocket connection where Discord sends the bot live events such as new messages, members joining or voice changes. Which events it receives depends on its [gateway intents](https://www.jalkarna.in/based/learn/what-are-discord-gateway-intents/).
- **The REST API**, ordinary HTTP requests the bot makes to take actions, like sending a message, assigning a role or deleting a message.

When a member runs a command, the bot's code decides what to do and calls the API to do it. Bots can also receive [slash command](https://www.jalkarna.in/based/learn/slash-commands-vs-prefix-commands/) interactions from Discord directly.

## What is the difference between a bot and a user?

Bots are real accounts in Discord's system, but with different rules. They are created in the Discord Developer Portal as an application, they log in with a token instead of a password, and they join servers through an invite rather than by accepting a friend request. They are subject to the same [permissions and roles](https://www.jalkarna.in/based/learn/how-discord-permissions-work/) as members, plus API rate limits.

## What can Discord bots do?

- **Moderation:** remove spam, filter links, review messages or log actions.
- **Community:** welcome messages, verification, giveaways, leaderboards.
- **Music and voice:** stream audio into a voice channel.
- **Utilities:** polls, reminders, role menus, ticket systems.
- **AI:** answer questions, summarize conversations, generate images.

A bot can only do what its permissions allow. A bot without **Manage Messages** cannot delete messages, however good its code is.

## Are Discord bots safe?

A bot is as trustworthy as whoever runs it. When you add one, you grant it the permissions you approve on the invite screen, so a safe habit is to grant only what the features you use need. Be careful with bots from unknown sources, never give a bot **Administrator** without a strong reason, and check what the bot says about how it handles data. Our article on [how Discord bots handle your data](https://www.jalkarna.in/based/learn/how-discord-bots-handle-your-data/) covers what to look for.

## How do you add a bot?

You use an invite link built through Discord's OAuth2 flow. You need the **Manage Server** permission in the target server. The full process is in [how to add a bot to a Discord server](https://www.jalkarna.in/based/learn/how-to-add-a-bot-to-a-discord-server/).

## Common mistakes with bots

- **Bot cannot see a channel.** Channel overwrites may deny it **View Channel**.
- **Bot cannot assign a role.** Its highest role must sit above the role it is assigning. See [roles and hierarchy](https://www.jalkarna.in/based/learn/discord-roles-and-role-hierarchy/).
- **Commands do nothing.** The bot may be offline, lack permission to send messages in that channel, or the command may be restricted to certain roles.

## Doing this with Based

Based is a public AI Discord bot that chats when you mention it or reply to it, plays music, joins voice channels for spoken conversations, and offers opt-in modules like welcome messages and giveaways. It is in 300+ servers. Use `/help` to see commands and feature availability, and note that every slash command also works with the "." prefix, such as `.help`. Read the [getting started doc](https://www.jalkarna.in/based/docs/getting-started/) or browse the [command list](https://www.jalkarna.in/based/commands/).


## FAQ

### Is a Discord bot a real user?

It is a separate type of account that logs in with a token and runs under a program's control. It appears in the member list with a BOT tag.

### Do Discord bots need to be online all the time?

The bot's program must be running to respond. If the host is down, the bot shows as offline and its commands do nothing until it reconnects.

### Can anyone make a Discord bot?

Yes. Anyone with a Discord account can create an application in the Developer Portal and write a bot using a library or the API directly.

### Can a bot read my private messages?

A bot can only see messages in channels it can access, and DMs sent to it directly. It cannot read your DMs with other people.

## Related
- [How to add a bot to a Discord server](https://www.jalkarna.in/based/learn/how-to-add-a-bot-to-a-discord-server/)
- [What are Discord gateway intents?](https://www.jalkarna.in/based/learn/what-are-discord-gateway-intents/)
- [Slash commands vs prefix commands on Discord](https://www.jalkarna.in/based/learn/slash-commands-vs-prefix-commands/)
- [How do Discord bots handle your data?](https://www.jalkarna.in/based/learn/how-discord-bots-handle-your-data/)
