How to use the discord-backup.load function in discord-backup

To help you get started, we’ve selected a few discord-backup examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Androz2091 / AtlantaBot / commands / Administration / backup.js View on Github external
backup.fetch(backupID).then(async () => {
                message.channel.send(message.language.get("BACKUP_CONFIRMATION"));
                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(message.language.get("BACKUP_ERR_TIMEOUT"));
                });
                // When the author of the command has confirmed that he wants to load the backup on his server
                message.author.send(message.language.get("BACKUP_START_SAVING"));
                // Load the backup
                backup.load(backupID, message.guild).then(() => {
                    // When the backup is loaded, delete them from the server
                    backup.delete(backupID);
                    message.author.send(message.language.get("BACKUP_LOAD_SUCCESS"));
                }).catch((err) => {
                    // If an error occurenced
                    return message.author.send(message.language.get("ERR_OCCURENCED"));
                });
            }).catch((err) => {
                // if the backup wasn't found

discord-backup

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

MIT
Latest version published 1 year ago

Package Health Score

64 / 100
Full package analysis