How to use the discord-backup.create 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
async run (message, args, data) {

        let status = args[0];
        if(!status){
            return message.channel.send(message.language.get("BACKUP_ERR_STATUS"));
        }

        if(status === "create"){
            backup.create(message.guild).then((backupID) => {
                message.channel.send(message.language.get("BACKUP_CREATE_SUCCESS"));
                message.author.send(message.language.get("BACKUP_CREATE_SUCCESS_ID", backupID))
            }).catch((err) => {
                return message.channel.send(message.language.get("ERR_OCCURENCED"));
            });
        } else if (status === "load"){
            let backupID = args[1];
            if(!backupID){
                return message.channel.send(message.language.get("BACKUP_ERR_ID"));
            }
            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"]

discord-backup

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

MIT
Latest version published 2 years ago

Package Health Score

48 / 100
Full package analysis