{"_id":"@coffeebots/discord-backup","name":"@coffeebots/discord-backup","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@coffeebots/discord-backup","version":"1.0.0","description":"A complete framework to facilitate server backup using discord.js v14","main":"lib/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","format":"prettier --write \"src/**/*.ts\"","lint":"tslint -p tsconfig.json"},"repository":{"type":"git","url":"git+https://github.com/coffeebotsxyz/discord-backup.git"},"keywords":["discord","discord.js","backup","clone","bot","discord-backup"],"author":{"name":"coffeebotsxyz"},"license":"MIT","bugs":{"url":"https://github.com/coffeebotsxyz/discord-backup/issues"},"homepage":"https://github.com/coffeebotsxyz/discord-backup/blob/master/README.md","dependencies":{"axios":"^1.6.8","discord.js":"^14.14.1"},"devDependencies":{"@types/node":"^18.11.18","prettier":"^2.0.4","tslint":"^6.1.1","tslint-config-prettier":"^1.18.0","typescript":"^5.4.5"},"_id":"@coffeebots/discord-backup@1.0.0","gitHead":"1007012d493b1be42d0a9e0915da69af4aa10073","types":"./lib/index.d.ts","_nodeVersion":"20.8.1","_npmVersion":"10.8.1","dist":{"integrity":"sha512-ro8e2UWA4y4Y2QYl+YyghVLBrr56QPnJuh0kbr0FgOQERQucpgna3S8KhlyWTWBf3sy0x8dLUM4i5lVIJLQKjg==","shasum":"06cc66bc61bb692a9cb0a1ba95616e5496cad97e","tarball":"https://registry.npmjs.org/@coffeebots/discord-backup/-/discord-backup-1.0.0.tgz","fileCount":49,"unpackedSize":55294,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDtkTBqLGWjh7/Hpo+/zPgpRfZEFO8NgPSVuyzfXzZSQwIgDlJlkinyubjUFbfX0WnnnN/0Sbh0yaEOXadV7oP2mzs="}]},"_npmUser":{"name":"duckodas","email":"duckodas@gmail.com"},"directories":{},"maintainers":[{"name":"duckodas","email":"duckodas@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/discord-backup_1.0.0_1717882879725_0.5049920047149663"},"_hasShrinkwrap":false}},"time":{"created":"2024-06-08T21:41:19.566Z","1.0.0":"2024-06-08T21:41:19.938Z","modified":"2024-06-08T21:41:20.328Z"},"maintainers":[{"name":"duckodas","email":"duckodas@gmail.com"}],"description":"A complete framework to facilitate server backup using discord.js v14","homepage":"https://github.com/coffeebotsxyz/discord-backup/blob/master/README.md","keywords":["discord","discord.js","backup","clone","bot","discord-backup"],"repository":{"type":"git","url":"git+https://github.com/coffeebotsxyz/discord-backup.git"},"author":{"name":"coffeebotsxyz"},"bugs":{"url":"https://github.com/coffeebotsxyz/discord-backup/issues"},"license":"MIT","readme":"# @coffeebots/discord-backup\n\n<div align=\"left\">\n    <a href=\"https://discord.gg/9tnbkzwyMD\"> <img src=\"https://img.shields.io/discord/1217224916466929734?color=5865F2&logo=discord&logoColor=white\" alt=\"discord\"/> </a>\n    <a href=\"https://www.npmjs.com/package/@coffeebots/discord-backup\"> <img src=\"https://img.shields.io/npm/v/@coffeebots/discord-backup.svg?maxAge=3600\" alt=\"npm version\"/> </a>\n    <a href=\"https://www.npmjs.com/package/@coffeebots/discord-backup\"> <img src=\"https://img.shields.io/npm/dt/@coffeebots/discord-backup.svg?maxAge=3600\" alt=\"npm downloads\"/> </a>\n</div>\n\n<!-- [![downloadsBadge](https://img.shields.io/npm/dt/@coffeebots/discord-backup?style=for-the-badge)](https://npmjs.com/@coffeebots/discord-backup)\n[![versionBadge](https://img.shields.io/npm/v/@coffeebots/discord-backup?style=for-the-badge)](https://npmjs.com/@coffeebots/discord-backup) -->\n\n@coffeebots/discord-backup is a powerful [Node.js](https://nodejs.org) module that allows you to easily manage discord server backups!\n\n## Features\n\n-   ⏱️ Easy to use!\n-   🔥 Unlimited backups!\n-   ⏱️ Backup creation takes less than 10 seconds!\n-   ✨ Even restores messages with webhooks!\n-   🚀 And restores everything that is possible to restore (channels, roles, permissions, bans, emojis, name, icon, and more!)\n\n## Installation\n\n```cli\nnpm install --save @coffeebots/discord-backup\n```\n\n## Examples\n\n### Create\n\nCreate a backup for the server specified in the parameters!\n\n```js\n/**\n * @param {Guild} [Guild] - The discord server you want to backup\n * @param {object} [options] - The backup options\n */\n\nconst { create } = require(\"@coffeebots/discord-backup\");\ncreate(Guild, options).then((backupData) => {\n    console.log(backupData.id); // NSJH2\n});\n```\n\nClick [here](#create-advanced) to learn more about **backup options**.\n\n### Load\n\nAllows you to load a backup on a Discord server!\n\n```js\n/**\n * @param {string} [backupID] - The ID of the backup that you want to load\n * @param {Guild} [Guild] - The discord server on which you want to load the backup\n */\n\nconst { load, remove } = require(\"@coffeebots/discord-backup\");\nload(backupID, Guild).then(() => {\n    remove(backupID); // When the backup is loaded, it's recommended to delete it\n});\n```\n\n### Fetch\n\nFetches information from a backup\n\n```js\n/**\n * @param {string} [backupID] - The ID of the backup to fetch\n */\n\nconst { fetch } = require(\"@coffeebots/discord-backup\");\nfetch(backupID).then((backupInfos) => {\n    console.log(backupInfos);\n    /*\n    {\n        id: \"BC5qo\",\n        size: 0.05\n        data: {BackupData}\n    }\n    */\n});\n```\n\n### Remove\n\n**Warn**: once the backup is removed, it is impossible to recover it!\n\n```js\n/**\n * @param {string} [backupID] - The ID of the backup to remove\n */\n\nconst { remove } = require(\"@coffeebots/discord-backup\");\nremove(backupID);\n```\n\n### List\n\n**Note**: `backup#list()` simply returns an array of IDs, you must fetch the ID to get complete information.\n\n```js\nconst { list } = require(\"@coffeebots/discord-backup\");\nlist().then((backups) => {\n    console.log(backups); // Expected Output [ \"BC5qo\", \"Jdo91\", ...]\n});\n```\n\n### SetStorageFolder\n\nUpdates the storage folder to another\n\n```js\nconst { create, setStorageFolder } = require(\"@coffeebots/discord-backup\");\nsetStorageFolder(__dirname+\"/backups/\");\nawait create(guild); // Backup created in ./backups/\n```\n\n## Advanced usage\n\n### Create [advanced]\n\nYou can use more options for backup creation:\n\n```js\nconst { create } = require(\"@coffeebots/discord-backup\");\ncreate(guild, {\n    maxMessagesPerChannel: 10,\n    jsonSave: false,\n    jsonBeautify: true,\n    doNotBackup: [ \"roles\",  \"channels\", \"emojis\", \"bans\" ],\n    saveImages: \"url\"\n});\n```\n\n**maxMessagesPerChannel**: Maximum of messages to save in each channel. \"0\" won't save any messages.  \n**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.  \n**jsonBeautify**: Whether you want your json backup pretty formatted.  \n**doNotBackup**: Things you don't want to backup. Available items are: `roles`, `channels`, `emojis`, `bans`.  \n**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.\n\n### Load [advanced]\n\nAs you can see, you're able to load a backup from your own data instead of from an ID:\n\n```js\nconst { load } = require(\"@coffeebots/discord-backup\");\nload(backupData, guild, {\n    clearGuildBeforeRestore: true\n});\n```\n\n**clearGuildBeforeRestore**: Whether to clear the guild (roles, channels, etc... will be deleted) before the backup restoration (recommended).  \n**maxMessagesPerChannel**: Maximum of messages to restore in each channel. \"0\" won't restore any messages.\n\n## Restored things\n\nHere are all things that can be restored with `@coffeebots/discord-backup`:  \n\n* Server icon  \n* Server banner  \n* Server region  \n* Server splash  \n* Server verification level  \n* Server explicit content filter  \n* Server default message notifications  \n* Server embed channel  \n* Server bans (with reasons)  \n* Server emojis  \n* Server AFK (channel and timeout)  \n* Server channels (with permissions, type, nsfw, messages, etc...)  \n* Server roles (with permissions, color, etc...)\n\n### Example of things that can't be restored:\n\n* Server logs  \n* Server invitations  \n* Server vanity url\n\n## Support Us\nIf you find this project helpful and want to support our work, consider [supporting us](https://coffeebots.xyz/store). Your support helps us maintain and improve this project.","readmeFilename":"README.md"}