Migrating from Eris
Athena is a friendly fork. Most Eris code works with minor changes.
Athena is a friendly fork. Most Eris code works with minor changes.
TL;DR
- Import from
'athena'instead of'eris'. - Pass
GatewayIntentBitsvalues (or modern name strings) tointents;client.intentsis aGatewayIntentBitfield. - Types come from
discord-api-types/v10, re-exported asConstants. - Modern features are first class: Components V2, monetization, integration types and contexts, threads, auto-moderation, scheduled events, soundboard.
- Voice audio is not bundled; pair with a dedicated voice library.
Imports
// Eris
const Eris = require('eris');
const client = new Eris('Bot ...', { intents: ['guilds', 'guildMessages'] });
// Athena
import { Client, GatewayIntentBits } from 'athena';
const client = new Client('Bot ...', { intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages] });String intents still work but must match GatewayIntentBits key names, not Eris's lowercase aliases.
Renamed structures
| Eris | Athena |
|---|---|
TextChannel | GuildTextChannel |
VoiceChannel | GuildVoiceChannel |
| others | mostly the same |
Permissions
// Eris
member.permissions.has('manageMessages');
// Athena
import { PermissionFlagsBits } from 'athena';
member.permissions.has(PermissionFlagsBits.ManageMessages);Interactions
Use the type guards to narrow:
if (interaction.isCommand()) { /* CommandInteraction */ }
if (interaction.isComponent()) { /* ComponentInteraction */ }Read command options with typed getters (getString, getRequiredInteger, getUser, ...) rather than string lookups.
Components
Eris used raw JSON; Athena adds builders. See Components. For new layouts use NewComponentBuilder.
Commands
Eris had no slash command framework. Athena's CommandClient is the recommended entry point; see Commands framework. You can still route off interactionCreate yourself.
Voice
Athena does not include Eris's voice connection classes. Use a separate voice library and feed it voiceStateUpdate events plus Shard.sendWS for the voice opcode.
Gotchas
- Token still needs the
Botprefix. getAllUsers: truerequires theGuildMembersintent (Athena throws at construction otherwise).disableEventsuses Discord's official event names (TYPING_START, ...), not Eris aliases.client.requestHandler.request(...)still works for unwrapped endpoints.