discord-hosting.cloud
20% Off First MonthSee prices

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.

Updated 6 min read

LanguageLibraryMemory at idle (small bot)Notes
JavaScript / TypeScript (Node.js, Bun)discord.jsabout 60 to 120 MBThe largest ecosystem and most tutorials; ShardingManager for big bots
Pythondiscord.py, py-cord, nextcordabout 50 to 100 MBReadable, quick to write; AutoShardedBot built in
Java / KotlinJDA, Discord4Jabout 150 to 300 MBStrong typing and threads; the JVM needs more RAM up front
Godiscordgoabout 15 to 40 MBVery light, single binary
RustSerenity, Twilightabout 10 to 30 MBLightest and fastest; more code to write
TypeScript (Deno)discordeno, discord.jsabout 50 to 100 MBModern 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.