Files
discordeno/website/docs/migrating/eris.md
2023-02-28 13:43:06 -06:00

2.0 KiB

sidebar_position, sidebar_label
sidebar_position sidebar_label
1 Eris To Discordeno

Migrating From Eris To Discordeno Guide

Understanding The Goals of This Guide

This guide is a quick-paced walkthrough meant for explaining the migration process for Eris bots to using Discordeno. If you are not sure whether you want to migrate, please read Should I Migrate?

TypeScript

I really hope you wrote your bot with TypeScript as it is going to save you a lot of time. If you have not written it in TypeScript, you should probably start now. Using this migrating as a push to switch to TypeScript.

If your bot is using TypeScript, this migration will be a lot easier.

Getting Started

Open up a terminal and run tsc --watch --noEmit to keep TypeScript warning of us of errors that may appear as we migrate.

Once you are ready, let's go ahead and install Discordeno, while we are at it we can uninstall eris. Open a new terminal and run the following command for the package manager you use:

// NPM users
npm uninstall eris && npm install @discordeno/client@19.0.0-next.99fbe1e
// Yarn users
yarn remove eris && yarn add @discordeno/client@19.0.0-next.99fbe1e

:::caution Currently, Discordeno v19 is in development. This is why you can not install it as @discordeno/client but have to specify the commit version. Once this version is released, it will be as easy as @discordeno/client. :::

We are going to use NayuBot which is a small bot written in TypeScript with Eris and is open source as the example we are going to migrate to Discordeno.

At this moment in time, the tsc terminal(from now one we are going to refer to this as TypeScript), is telling us we have 13 errors. This is because although we removed eris, we need to fix any imports it may have. So let's run a search in VSC to find any from 'eris'; and from "eris". We need to replace these with from '@discordeno/client' and from "@discordeno/client".

Tada! Time to run!