Athena
Athena is a modern Discord library for Node.js, maintained by Team Hydra. It is a TypeScript rewrite descended from Eris, kept current with Discord's API...
Athena is a modern Discord library for Node.js, maintained by Team Hydra. It is a TypeScript rewrite descended from Eris, kept current with Discord's API (slash commands, message components V2, modals, monetization, threads, auto-moderation, scheduled events, soundboard, and more). It runs everything from a first hobby bot to bots in millions of servers.
This wiki is written for three kinds of reader. Jump to the track that fits you:
I am new to programming or JavaScript
Start here and go in order. Each page assumes nothing and builds on the last.
I can code, I just want to build a bot with Athena
- Getting started - install, project layout, first command
- Client options - every option, with defaults
- Intents - which events you receive
- Events - the full event catalogue
- Structures - guilds, members, messages, channels, interactions
- Slash commands - building and deploying commands
- Components - buttons, select menus, Components V2 layouts
- Modals - pop-up forms
- The commands framework - the opinionated CommandClient
I run a large bot and need a reference
- REST and ratelimits - the request model, retries, file uploads
- Gateway and sharding - shards, concurrency, resuming
- Caching and memory - cache knobs, LRU, disabling caches
- Scaling to millions - clusters, Redis-backed caches, cross-cluster dedup
- Errors - error types and how to handle them
Reference and help
- Migrating from Eris
- FAQ
- Troubleshooting
- Glossary
- LLM and agent context - a compact summary to paste into AI coding tools
Install
npm install athena
# optional, for gateway compression:
npm install zlib-syncA 12 line bot
import { Client, GatewayIntentBits } from 'athena';
const client = new Client(`Bot ${process.env.DISCORD_TOKEN}`, {
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent]
});
client.on('ready', () => console.log(`Logged in as ${client.user.username}`));
client.on('messageCreate', (message) => {
if (message.content === '!ping') void client.createMessage(message.channel.id, 'Pong!');
});
void client.connect();New here? Head to Your first bot for the same thing explained line by line.