# Klang > Klang is a chat app for communities: servers with text and voice channels, direct messages, voice, video and screen sharing, on the web and on the desktop. Webhooks take the same URL and JSON as Discord’s. Klang is compatible with bots written for Discord’s API: in most cases, changing the URLs and the token is enough. Bots are in a closed beta for now. Klang can also be self-hosted: the server is open source (AGPL-3.0) and runs with Docker Compose. These are Klang’s developer docs (https://docs.klang.gg/), in English: webhooks, bots and the guide to running your own Klang. Every page is also in Markdown: the links below lead to it, and the page itself is the same address without `.md`. Every page in one file: [llms-full.txt](https://docs.klang.gg/llms-full.txt). Discord is a trademark of Discord Inc. Klang isn’t affiliated with, endorsed or sponsored by Discord Inc. ## Get started - [Introduction](https://docs.klang.gg/index.md): Guides and reference for connecting your tools to Klang and for running your own. Webhooks take the same URL shape and JSON as Discord’s, Klang is compatible with bots written for Discord’s API (in a closed beta for now), and the server is open source. ## Webhooks - [Webhooks](https://docs.klang.gg/webhooks.md): A webhook posts messages to a channel from outside Klang with nothing but a secret URL. No bot and no account, and most services that post to a Discord webhook can post to Klang too. - [Execute a webhook](https://docs.klang.gg/webhooks/execute.md): Post a message with a POST to the webhook’s URL, then edit or delete it with the same URL. The request body, mentions, rate limits and errors, with examples in curl, JavaScript and Python. - [Embeds](https://docs.klang.gg/webhooks/embeds.md): Embeds are the rich cards a webhook can attach to its message, with a color bar, an author, a linked title, Markdown, fields, images and a footer. Same format and limits as Discord’s. - [GitHub](https://docs.klang.gg/webhooks/github.md): Point a GitHub repository at a Klang webhook, with /github at the end of its URL, and its pushes, pull requests, issues and releases show up in a channel as embeds. ## Bots - [Bots](https://docs.klang.gg/bots.md): Klang is compatible with bots written for Discord’s API. In most cases, changing the URLs and the token is enough to run one on Klang. Bots are in a closed beta for now. - [Getting started](https://docs.klang.gg/bots/getting-started.md): Create an app in Klang’s developer portal, keep its bot token safe, choose its intents and add it to a server with its install link. Then check the token with one request. - [Connect your library](https://docs.klang.gg/bots/libraries.md): The exact settings that point discord.js, discord.py and JDA at Klang, and a bot that answers “pong” to “!ping” in each. Your bot’s logic doesn’t change. - [Slash commands](https://docs.klang.gg/bots/commands.md): Register a bot’s commands with discord.js, discord.py or JDA, globally or for one server, for the message box and for the menu of a person or a message. Options and choices, translations, who sees each command, and the limits. - [Responding to interactions](https://docs.klang.gg/bots/interactions.md): What your bot gets when someone uses one of its commands, and how it answers. A reply, an ephemeral message only that person sees, a deferred answer edited later, follow-ups and autocomplete, with the time limits and the errors you’ll meet. - [Buttons, menus and layouts](https://docs.klang.gg/bots/components.md): Put buttons and select menus on your bot’s messages, build whole messages out of layout components with IS_COMPONENTS_V2, and answer when someone presses or chooses. What Klang checks before your bot hears about a press, the limits and what isn’t supported. - [Modals](https://docs.klang.gg/bots/modals.md): Ask for text, choices and files in a form that pops up over Klang. Open a modal from a command or a component, its fields (text inputs, select menus, file uploads, radio groups and checkboxes), receive MODAL_SUBMIT and answer it, and what Klang checks before your bot gets it. - [HTTP interactions](https://docs.klang.gg/bots/http-interactions.md): Get your bot’s interactions as signed HTTP requests instead of gateway events, for bots that run on serverless platforms. The endpoint URL, verifying the Ed25519 signature, the check Klang runs when you save the URL, and a minimal Cloudflare Worker. - [Sending files](https://docs.klang.gg/bots/files.md): Attach files to a bot’s messages, edits, interaction replies and webhooks with multipart/form-data, as discord.js and discord.py already do. The size limits, which files show inline, alt text, attachment:// in embeds and components, files in ephemeral messages, and keeping or removing files when you edit. - [Gateway](https://docs.klang.gg/bots/gateway.md): How a bot stays connected to Klang’s gateway. The address, compression, intents, what arrives after connecting, resuming a session and the close codes, as Klang uses them. - [Limits and rate limits](https://docs.klang.gg/bots/limits.md): How many requests a bot can make and how Klang tells it to slow down, the gateway’s limits, and the product limits of the beta, such as 25 bots per server and 100 servers per bot until it’s verified. - [Differences from Discord’s API](https://docs.klang.gg/bots/differences.md): Where Klang behaves differently from Discord’s API version 10, and why. IDs, permissions, error codes, direct messages, looking up users, messages, moderation, managing a server, webhooks, threads, commands and interactions, components and modals, verification, links, and what Klang doesn’t have. - [Compatibility](https://docs.klang.gg/bots/compatibility.md): Every REST route and gateway event of Discord’s API version 10, and whether Klang supports it, supports part of it, doesn’t yet, or doesn’t have what it’s about. ## Bot API reference - [Bot API reference](https://docs.klang.gg/bots/reference.md): Every route of Klang’s bot API and every event of its gateway, with the fields Klang sends, real examples, the errors and the rate limits. How requests and answers work across the whole API. - [Users and the app](https://docs.klang.gg/bots/reference/users.md): The routes about the bot itself. Where its gateway is, its user, other people it shares a server with, its app and its interactions URL, the servers it’s in, leaving one, and opening a direct message. - [Servers](https://docs.klang.gg/bots/reference/guilds.md): Reading a server the bot is in. The server with its roles, emojis and stickers, the channels and threads the bot can see, its roles, its members and one member. - [Channels](https://docs.klang.gg/bots/reference/channels.md): Reading one channel the bot can see. A server’s text or voice channel with its overwrites, a thread, or one of the bot’s direct messages, with an example of each. - [Messages](https://docs.klang.gg/bots/reference/messages.md): Reading, sending, editing and deleting messages, the bot’s own reactions and the “is typing” indicator. Every field of the request body, with the checks, limits and errors of each route. - [Moderation](https://docs.klang.gg/bots/reference/moderation.md): Kicking and banning people, the ban list, timeouts, nicknames, giving and taking roles, and deleting messages in bulk. The permissions each route checks, the reason for the audit log, and the errors. - [Managing a server](https://docs.klang.gg/bots/reference/management.md): Creating, changing, ordering and deleting channels, their permission overwrites and roles, creating and revoking invites, and reading the audit log. What each route checks, the reason for the audit log, and the errors. - [Threads](https://docs.klang.gg/bots/reference/threads.md): Starting threads from a message or on their own, renaming, locking and deleting them, following them, and listing the active and archived ones. What each route checks, and the errors. - [Pins, polls, emojis, stickers and AutoMod](https://docs.klang.gg/bots/reference/server-content.md): Pinning messages, sending and closing polls, a server's emojis, creating and changing its stickers, and its AutoMod rules. What each route needs, how Klang maps Discord's fields, what it refuses, and the events. - [Webhooks](https://docs.klang.gg/bots/reference/webhooks.md): Creating, listing, changing, moving and deleting a server’s incoming webhooks with a bot token, and renaming or deleting one with its own token. What each route needs, the webhook object, the limits, the errors and the events. - [Commands](https://docs.klang.gg/bots/reference/commands.md): Registering, reading, editing and deleting an app’s commands, globally and per server, and reading who can use them in a server. Every field of a command, the checks, limits and errors of each route. - [Interactions](https://docs.klang.gg/bots/reference/interactions.md): Answering an interaction with its callback (a message, an update of the component’s message, a modal), and the webhook routes that use the interaction’s token for follow-ups and for reading, editing and deleting the answers. Every field, the time limits and the errors. - [Components](https://docs.klang.gg/bots/reference/components.md): Every component type Klang takes in messages and modals, with its fields and limits. Action rows, buttons, the five select menus, the layout components of IS_COMPONENTS_V2 messages, and the fields of a modal, from labels and text inputs to file uploads, radio groups and checkboxes. - [Objects](https://docs.klang.gg/bots/reference/objects.md): Every object the bot API and its gateway send, field by field, as Klang fills them in. Which fields are always there, which are only there sometimes, and which are always empty because Klang has nothing behind them. - [Gateway events](https://docs.klang.gg/bots/reference/gateway-events.md): The bot gateway frame by frame. Opcodes, the payloads of Hello, Identify, Ready and Resume, and every event Klang dispatches, with a real example and the intent each needs. - [Errors](https://docs.klang.gg/bots/reference/errors.md): What the bot API answers when something goes wrong. The error body, the errors of each field, the HTTP statuses and every JSON code Klang sends, with what it means in Klang. ## Self-hosting - [Self-hosting](https://docs.klang.gg/self-hosting.md): Run your own Klang on a server of yours with Docker Compose. It’s the same code as Klang Cloud, without billing and without plans. - [Requirements](https://docs.klang.gg/self-hosting/requirements.md): A Linux server with Docker, four DNS hostnames pointing at it, and a few ports open. What a small community needs, IPv6, and what NAT means for voice. - [Install](https://docs.klang.gg/self-hosting/install.md): From a release of klang-server to a running install with its first admin, in eight steps. - [Try it on your computer](https://docs.klang.gg/self-hosting/local.md): Run the kit on one computer with hostnames under .localhost and Caddy’s own certificates, without a domain or open ports. For trying it out, never for production. - [Configuration](https://docs.klang.gg/self-hosting/configuration.md): Who can sign up, Discover, bots, the limits that cost you disk and bandwidth, the anti-abuse values, and your own terms. Everything lives in .env. - [Behind your own reverse proxy](https://docs.klang.gg/self-hosting/reverse-proxy.md): When nginx, Traefik or another proxy already holds ports 80 and 443, Klang’s Caddy goes behind it. What changes in the kit, what your proxy must pass on, and how Klang still sees each visitor’s IP. - [Voice and TURN](https://docs.klang.gg/self-hosting/voice.md): How calls reach your server, the three media ports, the TURN relay over UDP, and what doesn’t work yet for people behind firewalls that only allow HTTPS. - [Email](https://docs.klang.gg/self-hosting/email.md): Klang sends email to verify addresses and reset passwords. Use any SMTP server, or Resend, or none at all, and what the app hides without it. - [Files](https://docs.klang.gg/self-hosting/files.md): Where attachments, avatars and emojis live, why they’re served from their own hostname, what anyone can read, and what’s kept privately for the staff. - [Updating](https://docs.klang.gg/self-hosting/updating.md): Moving to a new release: back up, check out the new tag, pull the images and start again. The migrations run before the API, and open tabs reload by themselves. - [Backups](https://docs.klang.gg/self-hosting/backups.md): What to back up (the database, the files and .env), the commands to do it, and how to restore an install from them on the same or another machine. - [Troubleshooting](https://docs.klang.gg/self-hosting/troubleshooting.md): How to see what’s wrong, and the usual problems: certificates, a service that won’t start, files or voice that don’t load, email that doesn’t arrive. ## Optional - [Every page in one file](https://docs.klang.gg/llms-full.txt): the pages above, in this order. - [Developer terms](https://app.klang.gg/legal/developers): the terms for apps, bots and webhooks on Klang. - [Klang](https://klang.gg/): what Klang is, for people.