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)
npm install --save discord-backup- fs used to store backups in json files (
npm install --save fs) - randomstring used to generate backups ID (
npm install --save randomstring)
- discord.js - (
npm install --save discord.js) - discord.js-commando - (
npm install --save discord.js-commando) - eris - (
npm install --save eris)
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
});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
});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"
}
*/
});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);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", ...]
});