2.0.3 • Published 2 years ago

discord-backup-system v2.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Discord Backup System

By: ArviX#8443

Created for 0rion Project.

Installation

npm install discord-backup-system

Patch Note:

  • Backup files are now axbs2 format. The system will automatically convert axbs1 to axbs2 format if you were using an older version of the system.
  • The backup system is now a class. It will be needed to be initialized first.
  • You can now choose the order of the loading of the backup. I recommend you to use the default order.
  • The Backup ID is still editable.

Usage

Create a Backup

const BackupSystem = require('discord-backup-system');

client.BackupSystem = new BackupSystem("/backups/");
// ... 
// Your Message Event / Command
client.BackupSystem.create(message.guild, message.author.id, `${message.guild.id}-#{GEN_SHORT}#`).then(backupData => {
    message.channel.send(`This is your backup: \`${backupData.id}\``)
});

Usage

ParamsTypeExplicationDefault
guildGuildGuild To BackupNone
authorIdSnowflakeAuthor of the backupNone
nameStringBackup Name (#{GEN}# to generated a random string and #{GEN_SHORT}# to generate a shorter strings)Generated

Result

ParamsTypeExplication
idStringBackup Id
pathStringBackup Path (Path/backup_id.axbs2)
backupBackupBackup Data

Backup Info

const BackupSystem = require('discord-backup-system');

client.BackupSystem = new BackupSystem("/backups/");
// ... 
// Your Message Event / Command
client.BackupSystem.getBackupInfo(backup_id).then(backupData => {
    message.channel.send(`Backup Size: ${Math.floor(backupData.size)} MB`)
});

Usage

Usage ParamsTypeExplicationDefault
backup_idStringBackup Id to give infoNone

Result

Result ParamsTypeExplication
sizeNumberSize in MB
backup_idStringBackup Id
createdAtNumberCreation timestamp
authorIdStringThe Creator of the backup ID
Guild{ id: string; owner_id: string }The guild data
existsBoolReturn if file exists ( If Not, only exists param will be returned )

Get All Backups

/* NOT IMPLEMENTED YET */
const BackupSystem = require('discord-backup-system');

client.BackupSystem = new BackupSystem("/backups/");
// ... 
// Your Message Event / Command
client.BackupSystem.getAllBackups(backup_id, message.guild, '/backup/');

Usage

Usage ParamsTypeExplicationDefault

Result

Result ParamsTypeExplication

Backup Delete

const BackupSystem = require('discord-backup-system');

client.BackupSystem = new BackupSystem("/backups/");
// ... 
// Your Message Event / Command
client.BackupSystem.deleteBackup(backup_id);

Usage

Usage ParamsTypeExplicationDefault
backup_idStringBackup IdNone

Result

Result ParamsTypeExplication
backup_idStringBackup Id
deletedBoolDeleted or not
existsBoolReturn if file exists (If Not, only exists param will be in returned)

Load Backup

const BackupSystem = require('discord-backup-system');

client.BackupSystem = new BackupSystem("/backups/");
// ... 
// Your Message Event / Command
client.BackupSystem.load(backup_id, message.guild);

Usage

Usage ParamsTypeExplicationDefault
backup_idStringBackup IdNone
guildGuildGuild to load backupNone
orderStringOrder of loadingchannels_roles&create_emojis&delete_emojis&bans&guild

Result

Result ParamsTypeExplication
BackupBackupBackup Data

Is A Backup File?

const BackupSystem = require('discord-backup-system');

client.BackupSystem = new BackupSystem("/backups/");
// ... 
// Your Message Event / Command
client.BackupSystem.isBackupFile(backup_id);

Usage

Usage ParamsTypeExplicationDefault
backup_idStringBackup IdNone

Result

Result ParamsTypeExplication
isValidBackupFileBoolIs Valid Backup File
isOldTimerBoolIs Old Timer (axbs1 format)
versionNumber / NullVersion of the backup
convertibleBoolIs the file convertible to axbs2

Make Backup File Compatible

const BackupSystem = require('discord-backup-system');

client.BackupSystem = new BackupSystem("/backups/");
// ... 
// Your Message Event / Command
client.BackupSystem.convertBackup(backup_id);

Usage

Usage ParamsTypeExplicationDefault
backup_idStringBackup IdNone

Result

Result ParamsTypeExplication
idStringBackup Id
pathStringBackup Path (Path/backup_id.axbs2)
backupBackupBackup Data
2.0.3

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.7

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.0

3 years ago