Skip to content

sswensen/discord-backup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord Backup

Note: This package is under development and will be updated frequently.

Discord Backup is a powerful Node.js module that allows you to easily manage discord server backups.

  • Restores channels
  • Restores emojis
  • Restores bans
  • Restores permissions (for role and channels)
  • Restores messages
  • Restores the guild configuration (notification settings, name, icon)

Installation

npm install --save discord-backup

Required packages

  • fs used to store backups in json files (npm install --save fs)
  • randomstring used to generate backups ID (npm install --save randomstring)

Optional

Functions

Create

Create a backup for the server specified in the parameters!

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

var backup = require("discord-backup");
backup.create(Guild).then((backupID) => {
    console.log(backupID); // NSJH2
});

Load

Allows you to load a backup on a Discord server!

/**
 * @param {string} [backupID] - The ID of the backup that you want to load
 * @param {object} [Guild] - The discord server on which you want to load the backup
 */

var backup = require("discord-backup");
backup.load(backupID, Guild).then(() => {
    backup.delete(backupID); // When the backup is loaded, it's recommended to delete it
});

Fetch

Fetches information from a backup

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

var backup = require("discord-backup");
backup.fetch(backupID).then((backupInfos) => {
    console.log(backupInfos);
    /*
    {
        ID: "BC5qo",
        guildID: "573098923984551952",
        createdTimestamp: 1559329309168,
        size: "0.05MB"
    }
    */
});

Delete

Warn: once the backup is deleted, it is impossible to recover it!

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

var backup = require("discord-backup");
backup.delete(backupID);

List

Note: backup#list() simply returns an array of IDs, you must fetch the ID to get complete information.

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

About

A complete framework to facilitate server backup using discord.js v12

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%