Guide
Choosing a language and library for a Discord bot
Every major language has a solid Discord library. Pick the language you know; the differences that matter for hosting are memory use and how sharding works.
| Language | Library | Memory at idle (small bot) | Notes |
|---|---|---|---|
| JavaScript / TypeScript (Node.js, Bun) | discord.js | about 60 to 120 MB | The largest ecosystem and most tutorials; ShardingManager for big bots |
| Python | discord.py, py-cord, nextcord | about 50 to 100 MB | Readable, quick to write; AutoShardedBot built in |
| Java / Kotlin | JDA, Discord4J | about 150 to 300 MB | Strong typing and threads; the JVM needs more RAM up front |
| Go | discordgo | about 15 to 40 MB | Very light, single binary |
| Rust | Serenity, Twilight | about 10 to 30 MB | Lightest and fastest; more code to write |
| TypeScript (Deno) | discordeno, discord.js | about 50 to 100 MB | Modern runtime with built-in TypeScript |
Memory figures are rough ballparks for a small bot with default caching, from common experience; your bot's caches decide the real number.
What the bot servers run
Bot servers have ready options for Node.js (discord.js) and Python (discord.py, py-cord, nextcord), plus general language runtimes for Java, Go, Rust, Bun and Deno. Pick the matching one when you create the server.