Git Product home page Git Product logo

discord-backup's Introduction

Discord Backup

downloadsBadge versionBadge

Note: this module uses recent discordjs features and requires discord.js v13.

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

  • Unlimited backups!
  • Backup creation takes less than 10 seconds!
  • Even restores messages with webhooks!
  • And restores everything that is possible to restore (channels, roles, permissions, bans, emojis, name, icon, and more!)

Changelog

  • Supports base64 for emojis/icon/banner backup
  • New option to save backups in your own database
  • backup#delete() removed in favor of backup#remove()

Installation

npm install --save discord-backup

Examples

You can read this example bot on Github: backups-bot

Create

Create a backup for the server specified in the parameters!

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

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

Click here to learn more about backup options.

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 {Guild} [Guild] - The discord server on which you want to load the backup
 */

const backup = require("discord-backup");
backup.load(backupID, Guild).then(() => {
    backup.remove(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
 */

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

Remove

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

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

const backup = require("discord-backup");
backup.remove(backupID);

List

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

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

SetStorageFolder

Updates the storage folder to another

const backup = require("discord-backup");
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]

You can use more options for backup creation:

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

maxMessagesPerChannel: Maximum of messages to save in each channel. "0" won't save any messages.
jsonSave: Whether to save the backup into a json file. You will have to save the backup data in your own db to load it later.
jsonBeautify: Whether you want your json backup pretty formatted.
doNotBackup: Things you don't want to backup. Available items are: roles, channels, emojis, bans.
saveImages: How to save images like guild icon and emojis. Set to "url" by default, restoration may not work if the old server is deleted. So, url is recommended if you want to clone a server (or if you need very light backups), and base64 if you want to backup a server. Save images as base64 creates heavier backups.

Load [advanced]

As you can see, you're able to load a backup from your own data instead of from an ID:

const backup = require("discord-backup");
backup.load(backupData, guild, {
    clearGuildBeforeRestore: true
});

clearGuildBeforeRestore: Whether to clear the guild (roles, channels, etc... will be deleted) before the backup restoration (recommended).
maxMessagesPerChannel: Maximum of messages to restore in each channel. "0" won't restore any messages.

Example Bot

// Load modules
const Discord = require("discord.js"),
backup = require("discord-backup"),
client = new Discord.Client(),
settings = {
    prefix: "b!",
    token: "YOURTOKEN"
};

client.on("ready", () => {
    console.log("I'm ready !");
});

client.on("message", async message => {

    // This reads the first part of your message behind your prefix to see which command you want to use.
    let command = message.content.toLowerCase().slice(settings.prefix.length).split(" ")[0];

    // These are the arguments behind the commands.
    let args = message.content.split(" ").slice(1);

    // If the message does not start with your prefix return.
    // If the user that types a message is a bot account return.
    // If the command comes from DM return.
    if (!message.content.startsWith(settings.prefix) || message.author.bot || !message.guild) return;

    if(command === "create"){
        // Check member permissions
        if(!message.member.hasPermission("ADMINISTRATOR")){
            return message.channel.send(":x: | You must be an administrator of this server to request a backup!");
        }
        // Create the backup
        backup.create(message.guild, {
            jsonBeautify: true
        }).then((backupData) => {
            // And send informations to the backup owner
            message.author.send("The backup has been created! To load it, type this command on the server of your choice: `"+settings.prefix+"load "+backupData.id+"`!");
            message.channel.send(":white_check_mark: Backup successfully created. The backup ID was sent in dm!");
        });
    }

    if(command === "load"){
        // Check member permissions
        if(!message.member.hasPermission("ADMINISTRATOR")){
            return message.channel.send(":x: | You must be an administrator of this server to load a backup!");
        }
        let backupID = args[0];
        if(!backupID){
            return message.channel.send(":x: | You must specify a valid backup ID!");
        }
        // Fetching the backup to know if it exists
        backup.fetch(backupID).then(async () => {
            // If the backup exists, request for confirmation
            message.channel.send(":warning: | When the backup is loaded, all the channels, roles, etc. will be replaced! Type `-confirm` to confirm!");
                await message.channel.awaitMessages(m => (m.author.id === message.author.id) && (m.content === "-confirm"), {
                    max: 1,
                    time: 20000,
                    errors: ["time"]
                }).catch((err) => {
                    // if the author of the commands does not confirm the backup loading
                    return message.channel.send(":x: | Time's up! Cancelled backup loading!");
                });
                // When the author of the command has confirmed that he wants to load the backup on his server
                message.author.send(":white_check_mark: | Start loading the backup!");
                // Load the backup
                backup.load(backupID, message.guild).then(() => {
                    // When the backup is loaded, delete them from the server
                    backup.remove(backupID);
                }).catch((err) => {
                    // If an error occurred
                    return message.author.send(":x: | Sorry, an error occurred... Please check that I have administrator permissions!");
                });
        }).catch((err) => {
            console.log(err);
            // if the backup wasn't found
            return message.channel.send(":x: | No backup found for `"+backupID+"`!");
        });
    }

    if(command === "infos"){
        let backupID = args[0];
        if(!backupID){
            return message.channel.send(":x: | You must specify a valid backup ID!");
        }
        // Fetch the backup
        backup.fetch(backupID).then((backupInfos) => {
            const date = new Date(backupInfos.data.createdTimestamp);
            const yyyy = date.getFullYear().toString(), mm = (date.getMonth()+1).toString(), dd = date.getDate().toString();
            const formatedDate = `${yyyy}/${(mm[1]?mm:"0"+mm[0])}/${(dd[1]?dd:"0"+dd[0])}`;
            let embed = new Discord.MessageEmbed()
                .setAuthor("Backup Informations")
                // Display the backup ID
                .addField("Backup ID", backupInfos.id, false)
                // Displays the server from which this backup comes
                .addField("Server ID", backupInfos.data.guildID, false)
                // Display the size (in mb) of the backup
                .addField("Size", `${backupInfos.size} kb`, false)
                // Display when the backup was created
                .addField("Created at", formatedDate, false)
                .setColor("#FF0000");
            message.channel.send(embed);
        }).catch((err) => {
            // if the backup wasn't found
            return message.channel.send(":x: | No backup found for `"+backupID+"`!");
        });
    }

});

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

Restored things

Here are all things that can be restored with discord-backup:

  • Server icon
  • Server banner
  • Server region
  • Server splash
  • Server verification level
  • Server explicit content filter
  • Server 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...)

Example of things that can't be restored:

  • Server logs
  • Server invitations
  • Server vanity url

discord-backup's People

Contributors

2jjj avatar androz2091 avatar dannyhpy avatar dependabot-preview[bot] avatar googlefeud avatar lolollllo avatar mr-kayjaydee avatar senpay98k avatar toledosdl avatar tymec avatar uthsho avatar xpl0itr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

discord-backup's Issues

Invite people

Is it possible to make it so the bot is able to invite everyone from the old server to the new one?

Error with infos

Hello,

The backup system works successfully, but the problem arises when I want to load, it always puts me: "Sorry, an error occur ... Please check that I have administrator permissions!" Every time. For he has permission. I searched deeply and found no errors. I simply did a setStorageFolder to store the data in a folder. It saves successfully, but neither load or info works ...

New saveImages option

Hi, I thing that it will be a good idea add imgur to the system for upload images, with that, the backup will be light and if the Discord is deleted, you can do this equally.

Announcement Channel

Please update this module to support Announcement channels. If the channel does not have community enabled, then use text channel instead

Restoring timestamps

Timestamps don't get restored.

I see that's because the messages are being added to text channels by webhook.send(), so they get the timestamp of when the backup was loaded.

Would be great if the timestamp could be assigned afterwards, but after a quick look through the discord.js api, I don't see an option for that.

Hmm, any ideas? :)

max messages ?

I have a very active discord. I used your sample bot . The issue I having is it is only saving like 10 messages per channel.

I increased the maxMessagesPerChannel to 1000000 and 100000 and 10000 . The bot runs , it gets up to 1.5 GB of memory after about 30 minutes and just stop without saving the backup file.

Could you point me in the right direction on how to get a full message backup? Can I adit the code or does it need a rewrite to do it?

Channels not backuping?

I tried the example bot and the channels are not backuping. Roles and bans are backuping properly. Can you please fix the issue or edit the example bot?

guild.iconURL is not a function

Can you help me?

When I run this:

// Create the backup
backup.create(message.guild, { jsonBeautify: true }).catch(console.error)

It happens:

TypeError: guild.iconURL is not a function
    at /home/user/projet/node_modules/discord-backup/lib/index.js:147:44
    at step (/home/user/projet/node_modules/discord-backup/lib/index.js:33:23)
    at Object.next (/home/user/projet/node_modules/discord-backup/lib/index.js:14:53)
    at /home/user/projet/node_modules/discord-backup/lib/index.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/home/user/projet/node_modules/discord-backup/lib/index.js:4:12)
    at /home/user/projet/node_modules/discord-backup/lib/index.js:119:83
    at new Promise (<anonymous>)
    at /home/user/projet/node_modules/discord-backup/lib/index.js:119:35
    at step (/home/user/projet/node_modules/discord-backup/lib/index.js:33:23) 

But

console.log(message.guild.iconURL);

The funny thing is that there is an image in message.guild.iconURL, and I use it without being a function.

rm -rf node_modules && rm package-lock.json && npm install

Yes, I already tried that. Unsuccessfully.


Additional information:

  • Node.js version: v13.7.0
  • Npm version: 6.13.6
  • Operation System: W10 (SO 19041,113)
  • WSL:
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.4 LTS
Release:        18.04
Codename:       bionic

load Error

It doesn't automatically turn off after 20,000 seconds...

Installing discord-backup for discord v11 doesn't work

I'm tryna install discord-backup for djs v11 but when i run

npm install Androz2091/discord-backup#discordjs-v11

it returns me

npm ERR! code ENOLOCAL
npm ERR! Could not install from "Androz2091\discord-backup@discordjs-v11" as it does not contain a package.json file.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Win10SSD1\AppData\Roaming\npm-cache\_logs\2020-04-09T15_58_28_380Z-debug.log```

any help ?

ERROR node modules\discord-backup\lib\index.js

Waiting for the deError: Cannot find module 'c:\Users\frees\OneDrive\Bureau\futuraself\node_modules\discord-backup\lib\index.js'. Please verify that the package.json has a valid "main" entry

there is the error

Errod discord.js version 12

Hello i have a problem...

I type: b!create and i have this error:

Uncaught Promise Error You must install and use discord.js version 12 or higher to use this package! [FATAL] Possibly Unhandled Rejection at: Promise Promise { 'You must install and use discord.js version 12 or higher to use this package!' } reason: undefined

How to resolve this??

Storage Folder Problem

Hey

I made a backup code using your package
I set a storage folder for it but I always get this error

I made a folder called backup to store the data in, any solutions?
I use glitch host, should I use my PC or a Linux, which are better?

Custom files names.

Possibility to set a custom name for backuped files, instead of a random id.

Error when install

npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno -4058
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t ssh://[email protected]/discordjs/discord.js.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Romaiin\AppData\Roaming\npm-cache_logs\2019-12-25T18_46_43_748Z-debug.log

Error discord.js version

Hello i have a problem...

I type: b!create and i have this error:

Uncaught Promise Error You must install and use discord.js version 12 or higher to use this package!
[FATAL] Possibly Unhandled Rejection at: Promise Promise {
'You must install and use discord.js version 12 or higher to use this package!' } reason: undefined

How to resolve this??

Way to read data.

Hello, I was wondering if there is a way of reading data that has been saved.
For ex.

const SavedData = new Discord.MessageEmbed()
.setAuthor("Guild has been Backuped")
.setDescription("Number of Saved Channels, Roles, Emojis..")
.addField("Channels: ", number_of_saved_channels)
.addField("Roles: ", number_of_saved_roles)
.addField("Emojis", number_of_saved_emojis)
.setTimestamp()

Different id setup

Is there a way to shorten the id? or atleast make it something like 8 characters long with a mixture of numbers and letters? I looked through the code and didn't see anything that caught my eye.

invite people

if I load a backup will it invite the people from the old server?

I am a noob.

can I have a link to ur server? I need help. I know nothing about programming. Please help me use this cloner

EODENT Error

Hello there. It could just be my own incompetence, but whenever I try to install the package I get an EOENT error. I'd like to mention in advance I'm a novice with these types of things, but I have Node.js installed and I've installed and used some modules before. Thank you.

Loading backup from file

Hey, trying to load the attached test backup file
684874311907016704.json.txt
(added the txt extension for github to want to attach it)

(node:24652) UnhandledPromiseRejectionWarning: TypeError [INVALID_TYPE]: Supplied overwrites is not an Array or Collection of Permission Overwrites.
at CategoryChannel.overwritePermissions (/Users/robert/Desktop/DiscordBackupBot/node_modules/discord.js/src/structures/GuildChannel.js:208:9)
at Object.<anonymous> (/Users/robert/Desktop/DiscordBackupBot/node_modules/discord-backup/lib/master/util.js:181:71)

Tried an early out in case the array of permissions is empty to get rid of this exception, but the restore still fails - no text channels get restored.

(An unrelated issue, but might point out that there's something wrong with my setup: loading backup by id doesn't work either - the backup can't be found, even though listing the backups with list() shows the id)

Backup fails to create

Hi, whenever I try to use the b!create command, I get this error in console:

(node:19982) UnhandledPromiseRejectionWarning: TypeError: backup.create is not a function
    at Client.<anonymous> (/root/discord-backup/index.js:33:16)
    at Client.emit (events.js:311:20)
    at MessageCreateAction.handle (/root/discord-backup/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (/root/discord-backup/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (/root/discord-backup/node_modules/discord.js/src/client/websocket/WebSocketManager.js:386:31)
    at WebSocketShard.onPacket (/root/discord-backup/node_modules/discord.js/src/client/websocket/WebSocketShard.js:435:22)
    at WebSocketShard.onMessage (/root/discord-backup/node_modules/discord.js/src/client/websocket/WebSocketShard.js:293:10)
    at WebSocket.onMessage (/root/discord-backup/node_modules/ws/lib/event-target.js:120:16)
    at WebSocket.emit (events.js:311:20)
    at Receiver.receiverOnMessage (/root/discord-backup/node_modules/ws/lib/websocket.js:801:20)
(node:19982) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:19982) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Anyone knows what's wrong?

Setting up automatic backups

Hi, I was trying to set up the bot to do daily automatic backups using the cron tool by npm. I'm struggling into one issue, i'm getting this error:

 TypeError: guild.iconURL is not a function
5|index  |     at /root/bot/node_modules/discord-backup/lib/index.js:147:44
5|index  |     at step (/root/bot/node_modules/discord-backup/lib/index.js:33:23)
5|index  |     at Object.next (/root/bot/node_modules/discord-backup/lib/index.js:14:53)
5|index  |     at /root/bot/node_modules/discord-backup/lib/index.js:8:71
5|index  |     at new Promise (<anonymous>)
5|index  |     at __awaiter (/root/bot/node_modules/discord-backup/lib/index.js:4:12)
5|index  |     at /root/bot/node_modules/discord-backup/lib/index.js:119:83
5|index  |     at new Promise (<anonymous>)
5|index  |     at /root/bot/node_modules/discord-backup/lib/index.js:119:35
5|index  |     at step (/root/bot/node_modules/discord-backup/lib/index.js:33:23)

Consider that the bot is working fine if I use it with the original code and I have the latest updates for discord.js, npm and such, so I think I messed up while coding the automatic backup part, can anyone give me an help or advice?
This is the code:

client.on("ready", () => {
    console.log("I'm ready !");
    
        const channel = client.channels.cache.get('669955470823260190');
        const CronJob = require('cron').CronJob;
        
let autobackup = new CronJob ("00 15 17 * * *", function() {
console.log("Backupping now!");
channel.send('Daily Backup starting now.');
   backup.create({
            jsonBeautify: true
        })
        }, null, true, 'Europe/Rome');
    autobackup.start();
    
});

No delete of categorie/channels/roles...etc after loading a backup

Hello,
i actually have an issue when i try to load a backup, all the channels in my discord are always here.
So they are not deleted. after that all my backup is importing channel role categories.

I don't have any errors on the console.
i had try with parameter : clearGuildBeforeRestore: true, and without but nothing change

thanks in advance

just a question

What does the jsonSave option do? Is it just so it saves the backups to the bot folder?

Backup not found while a backup existing.

After some troubleshooting.. i figured out that problem was in functions/utils.js:76:84
Error was miss-thrown by the promise at line 150 in index.js.

Original error stack:

TypeError: Cannot read property 'id' of undefined
 at guild.roles.filter (/home/mraugu/ftp/bots/f-u/node_modules/discord-backup/functions/utils.js:76:84)
 at Map.filter (/home/mraugu/ftp/bots/f-u/node_modules/discord.js/src/util/Collection.js:227:11)
 at Object.clearGuild (/home/mraugu/ftp/bots/f-u/node_modules/discord-backup/functions/utils.js:76:17)
 at getBackupInformations.then (/home/mraugu/ftp/bots/f-u/node_modules/discord-backup/index.js:164:29)

It was fixed by fixing the filtering condition on the line 76.

// Old:
guild.roles.filter((role) => role.editable && role.id !== guild.roles.everyone.id).forEach((role) => {
  role.delete().catch((err) => {});
});
// New:
guild.roles.filter((role) => role.managed === false  && role.id !== guild.id && role.editable).forEach((role) => {
  role.delete().catch((err) => {});
});

Custom IDs

Hello, I would like to know if there is a way to set an ID for the backup when creating it.

Cannot read property 'filter' of undefined

Im using atlanta master branch.

TypeError: Cannot read property 'filter' of undefined
    at Object.<anonymous> (Z:\Coding\Zeka Discord Bot\node_modules\discord-backup\lib\master\create.js:79:18)
    at step (Z:\Coding\Zeka Discord Bot\node_modules\discord-backup\lib\master\create.js:33:23)
    at Object.next (Z:\Coding\Zeka Discord Bot\node_modules\discord-backup\lib\master\create.js:14:53)
    at Z:\Coding\Zeka Discord Bot\node_modules\discord-backup\lib\master\create.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (Z:\Coding\Zeka Discord Bot\node_modules\discord-backup\lib\master\create.js:4:12)
    at Object.getRoles (Z:\Coding\Zeka Discord Bot\node_modules\discord-backup\lib\master\create.js:74:12)
    at Z:\Coding\Zeka Discord Bot\node_modules\discord-backup\lib\index.js:192:67
    at step (Z:\Coding\Zeka Discord Bot\node_modules\discord-backup\lib\index.js:33:23)
    at Object.next (Z:\Coding\Zeka Discord Bot\node_modules\discord-backup\lib\index.js:14:53)
    at fulfilled (Z:\Coding\Zeka Discord Bot\node_modules\discord-backup\lib\index.js:5:58)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

no load backup

I have the code , i create the backups
And for load this i enter the cmd but this don't work , this not replie a msg

the script :

if(message.content === config.prefix + "backup load") {
let args = message.content.slice("&backup load").trim().split(/ +/g);
if(!message.member.hasPermission("ADMINISTRATOR")){
return message.channel.send(":x: | You must be an administrator of this server to load a backup!");
}
let backupID = args[3];
if(!backupID){
return message.channel.send(":x: | You must specify a valid backup ID!");
}
// Fetching the backup to know if it exists
backup.fetch(backupID).then(async () => {
// If the backup exists, request for confirmation
backup.load("id", message.guild, {
clearGuildBeforeRestore: true
});
}).catch((err) => {
// if the backup wasn't found
return message.channel.send(":x: | No backup found for "+backupID+"!");
});

}

Loading a backup - cannot read property 'maxMessagePerChannel' of undefined

Hello,
When i'm loading a backup, all the channels appears, but after that i had a lot a these errors :

(node:3372) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'maxMessagesPerChannel' of undefined
at Object. (c:\Users\xBlad\OneDrive\Documents\TEST-BOT\blade_bot\node_modules\discord-backup\lib\master\util.js:256:105)
at step (c:\Users\xBlad\OneDrive\Documents\TEST-BOT\blade_bot\node_modules\discord-backup\lib\master\util.js:33:23)
at Object.next (c:\Users\xBlad\OneDrive\Documents\TEST-BOT\blade_bot\node_modules\discord-backup\lib\master\util.js:14:53)
at c:\Users\xBlad\OneDrive\Documents\TEST-BOT\blade_bot\node_modules\discord-backup\lib\master\util.js:8:71
at new Promise ()
at __awaiter (c:\Users\xBlad\OneDrive\Documents\TEST-BOT\blade_bot\node_modules\discord-backup\lib\master\util.js:4:12)
at c:\Users\xBlad\OneDrive\Documents\TEST-BOT\blade_bot\node_modules\discord-backup\lib\master\util.js:250:83
at processTicksAndRejections (internal/process/task_queues.js:97:5)

Can you help me ?

role permissions on text/voice channel

I guess it doesn't back them up. This is the biggest problem I have with "backup" ... it would be great if it was added and you can add the system that saves the role and gives them back the role to saved users.

guild.roles.forEach is not a function

Trying to create backup i get following error:

 (node:21278) UnhandledPromiseRejectionWarning: TypeError: guild.roles.forEach is not a function
    at Object.<anonymous> (/root/Desktop/discordjs/node_modules/discord-backup/lib/master/create.js:78:25)

Im using discordjs v12, bot has admin permissions and even admin role in server

seems like they changed some stuff in discordjs's API

Issue with backup ID

https://sourceb.in/627aec8bac

^^^ Above is my code
When I do !backup create, it send me a dm. The backup ID shown is true687285487278358529. Is there any way to get rid of the true?
Also, just wondering, where does the backup save? I want to delete it manually, is that possible?
Lastly, is it possible to list all backup ids?

Thanks for making this amazing package!

Auto assign roles

Hey, I was wondering if it's possible to make the bot automatically assign the roles that users had when you created the backup when loading the backup into a new server. What do you think about it?

automatically errors out

when I load a backup it automatically errors out saying it doesn't have admin perms in the server yet it does have perms...also is it possible to make it take a few seconds so it doesn't just nuke the server and then not work?

DiscordJS ver 12

This isn't even a thing yet?..
How is one supposed to go about getting version 12 of it xD

Error in creating backup

Error:

(node:25990) UnhandledPromiseRejectionWarning: TypeError: guild.iconURL is not a function
at /root/node_modules/discord-backup/lib/index.js:147:56
at step (/root/node_modules/discord-backup/lib/index.js:33:23)
at Object.next (/root/node_modules/discord-backup/lib/index.js:14:53)
at /root/node_modules/discord-backup/lib/index.js:8:71
at new Promise ()
at __awaiter (/root/node_modules/discord-backup/lib/index.js:4:12)
at /root/node_modules/discord-backup/lib/index.js:111:79
at new Promise ()
at /root/node_modules/discord-backup/lib/index.js:111:31
at step (/root/node_modules/discord-backup/lib/index.js:33:23)
(node:25990) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:25990) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Update backups

Add the possibility to update a backup. By giving the backup id and checking if the backup id is associated to the guild.

I have a problem for create a backup

My code is :

if(args[0] === "create"){
   if(!message.member.hasPermission("ADMINISTRATOR")){
            return message.channel.send(":x: | Tu dois ĂȘtre un administrateur pour Ă©xĂ©cuter cette commande !");
        }
 
        backup.create(message.guild).then((backupID) => {
          
            message.author.send("La backup a été crée, tu peux la load en faisant "+prefix+"load "+backupID+"`!");
        }).catch(() => {
          message.channel.send('Une erreur est survenue, merci de report ce bug Ă  Azkun#9867')
        });
    }

This code return message.channel.send('Une erreur est survenue, merci de report ce bug Ă  Azkun#9867'), this is for message.guild ? Or a another error ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.