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 GatewayIntentBits values (or modern name strings) to intents; client.intents is a GatewayIntentBitfield.
  • Types come from discord-api-types/v10, re-exported as Constants.
  • 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

ErisAthena
TextChannelGuildTextChannel
VoiceChannelGuildVoiceChannel
othersmostly 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 Bot prefix.
  • getAllUsers: true requires the GuildMembers intent (Athena throws at construction otherwise).
  • disableEvents uses Discord's official event names (TYPING_START, ...), not Eris aliases.
  • client.requestHandler.request(...) still works for unwrapped endpoints.