npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@eliware/discopy

v1.1.5

Published

Discord server backup & restore tool — export and restore roles, channels, permissions, emojis, stickers, webhooks, invites and more.

Readme

eliware.org

@eliware/discopy npm versionlicensebuild status

Discopy is a focused Discord server backup and restore utility built on top of the @eliware/discord framework. It provides commands and tooling to export a guild's configuration (roles, channels, permissions, emojis, stickers, events, invites, webhooks, etc.) into portable backups and to restore them into another guild. The project is ESM-first and designed to be run locally, as a systemd service, or inside Docker.


Table of Contents

Features

  • Backup and restore full guild configuration (roles, channels, categories, overwrites).
  • Export emojis and stickers into backups and re-upload on restore.
  • Recreate invites, webhooks, events, and bans during restore.
  • CLI-style Discord commands: backup, restore, reset, and help for interactive use.
  • Optional scheduled daily backups implemented in events/clientReady.mjs (default: 04:00 Eastern / 09:00 UTC).
  • Localized command and response strings under locales/.
  • Safe sequential processing to reduce rate-limit bursts when running backups/restores.

Getting Started

  1. Clone this project:

    git clone https://github.com/eliware/discopy.git
    cd discopy
    npm install
  2. Set up your environment:

    • Copy .env.example to .env and fill in your Discord bot token and any other required values. Typical values you will provide include your DISCORD_TOKEN (bot token) and optional configuration such as backup paths or scheduling toggles. See .env.example for the exact variables used by the app.
  3. Start the app locally:

    npm start
    # or
    node discopy.mjs
  4. Use the commands in Discord:

    • backup — create and save a backup for the current guild (creates a ZIP under backups/).
    • restore — restore a previously created backup into the current guild.
    • reset — helper to apply default configuration to a guild.
    • help — list available commands and usage.

Configuration

  • All runtime configuration is loaded from the .env file via dotenv. Copy .env.example and populate secrets and optional flags.
  • Scheduling: the bot contains a scheduler in events/clientReady.mjs that will optionally run daily backups at 09:00 UTC (04:00 EST). The code comments explain how to change time and DST behavior.

Running as a Service (systemd)

  1. Copy discopy.service to /usr/lib/systemd/system/discopy.service.

  2. Edit the paths and user/group as needed (point ExecStart to the installation path of discopy.mjs).

  3. Reload systemd and start the service:

    sudo systemctl daemon-reload
    sudo systemctl enable discopy
    sudo systemctl start discopy
    sudo systemctl status discopy

Docker

  1. Build the Docker image:

    docker build -t discopy .
  2. Run the container (pass .env for configuration):

    docker run --env-file .env discopy

Architecture & Files

  • Command handlers: commands/ — each command has a .json definition for Discord plus a .mjs runtime handler. Key commands: backup, restore, reset, help.
  • Backup collectors: src/backup/ — modules such as collectGuild.mjs, collectEmojis.mjs, and saveZip.mjs build and persist backup ZIPs.
  • Restore helpers: src/restore/ — many small, focused modules (e.g. createRoles.mjs, createChannels.mjs, uploadEmojis.mjs) re-create guild state from a backup archive.
  • Reset flow: src/reset/ — contains the logic to apply default settings and plans when resetting a guild.
  • Event wiring: events/clientReady.mjs — sets presence, pre-fetches members (when GUILD_MEMBERS intent is enabled), and schedules daily backups.

Customization

  • Add or modify commands in the commands/ directory; update the corresponding .json to change registration and localization.
  • Event handlers live in events/ and are auto-registered by the framework used in discopy.mjs.
  • Localization files live in locales/ — add languages or adjust translations used by command .json files and runtime responses.

Testing

  • Run the project's test suite with:

    npm test

Support

For help, questions, or to chat with the author and community, visit:

Discordeliware.org

eliware.org on Discord

License

MIT © 2025 Eli Sterling, eliware.org

Links