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 🙏

© 2024 – Pkg Stats / Ryan Hefner

discord-rebackup

v3.5.0

Published

An rewamped fork of the discord-backup module ! by the iHorizon Team

Downloads

126

Readme

Discord Server Backup Manager - Save, Load, and Restore with Ease!

downloadsBadge versionBadge

Note: This module leverages the latest pwss features and requires pwss v14.

Static Badge

Discord RE-Backup is a robust Node.js module designed for effortless management of Discord server backups.

  • Create unlimited backups in under 10 seconds!
  • Restore messages, even with webhooks!
  • Restore everything possible, including channels, roles, permissions, bans, emojis, name, icon, and more!

Installation

npm install --save discord-rebackup

Create

Create a backup for the specified Discord server with ease!

/**
 * @param {Guild} [Guild] - The Discord server you want to backup
 * @param {object} [options] - Backup options
 */

import backup from "discord-rebackup";

backup.create(Guild, options).then((backupData) => {
    console.log(backupData.id); // NSJH2
});

Click here to explore advanced backup options.

Load

Effortlessly load a backup onto a Discord server!

/**
 * @param {string} [backupID] - The ID of the backup you want to load
 * @param {Guild} [Guild] - The Discord server where you want to load the backup
 */

import backup from "discord-rebackup";

backup.load(backupID, Guild).then(() => {
    backup.remove(backupID); // Recommended to delete the backup after loading
});

Fetch

Retrieve information from a backup

/**
 * @param {string} [backupID] - The ID of the backup to fetch
 */

import backup from "discord-rebackup";

backup.fetch(backupID).then((backupInfos) => {
    console.log(backupInfos);
    /*
    {
        id: "BC5qo",
        size: 0.05
        data: {BackupData}
    }
    */
});

Remove

Warning: Once removed, a backup is irrecoverable!

/**
 * @param {string} [backupID] - The ID of the backup to remove
 */

import backup from "discord-rebackup";

backup.remove(backupID);

List

Note: backup#list() returns an array of IDs; fetching the ID provides complete information.

import backup from "discord-rebackup";

backup.list().then((backups) => {
    console.log(backups); // Expected Output [ "BC5qo", "Jdo91", ...]
});

SetStorageFolder

Update the storage folder location

import backup from "discord-rebackup";

backup.setStorageFolder(__dirname+"/backups/");
await backup.create(guild); // Backup created in ./backups/
backup.setStorageFolder(__dirname+"/my-backups/");
await backup.create(guild); // Backup created in ./my-backups/

Advanced Usage

Create [Advanced]

Utilize additional options for backup creation:

import backup from "discord-rebackup";

backup.create(guild, {
    maxMessagesPerChannel: 10,
    jsonSave: false,
    jsonBeautify: true,
    doNotBackup: [ "roles",  "channels", "emojis", "bans" ],
    saveImages: "base64"
});

maxMessagesPerChannel: Maximum messages to save in each channel. "0" saves no messages. jsonSave: Save the backup to a JSON file; save the backup data in your own DB for loading later. jsonBeautify: Format the JSON backup for better readability. doNotBackup: Exclude items from backup, such as roles, channels, emojis, bans. saveImages: Save images like guild icon and emojis as "url" or "base64" (recommended for server cloning).

Load [Advanced]

Load a backup from your own data instead of using an ID:

import backup from "discord-rebackup";

backup.load(backupData, guild, {
    clearGuildBeforeRestore: true
});

clearGuildBeforeRestore: Clear the guild (roles, channels, etc.) before the backup restoration (recommended). maxMessagesPerChannel: Maximum messages to restore in each channel. "0" restores no messages.

Example Bot

// Load modules
import backup from "discord-rebackup";
import { Client, EmbedBuilder } from "pwss";

client = new Client();
settings = {
    prefix: "b!",
    token: "YOURTOKEN"
};

// ... (rest of the bot code)

//Your secret token to log the bot in. (never share this to anyone!)
client.login(settings.token);

Restored Elements

Here are all elements that can be restored with discord-rebackup:

  • Server icon, banner, region, splash
  • Server verification level, explicit content filter, default message notifications
  • Server embed channel
  • Server bans (with reasons)
  • Server emojis
  • Server AFK (channel and timeout)
  • Server channels (with permissions, type, nsfw, messages, etc.)
  • Server roles (with permissions, color, etc.)

Note: Certain elements like server logs, invitations, and vanity URLs cannot be restored.

From Discord-Backup and edited by the heart of the iHorizon team!