npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@arnavk-09/discord-backups

v1.1.3

Published

Create backups of your discord server

Downloads

5

Readme

🧩 @arnavk-09/discord-backups

@arnavk-09/discord-backups is an easy-to-use npm package for creating and loading backups of Discord servers. The package is built on top of the popular discord.js library and provides a streamlined interface for creating and restoring backups.

Custom version of @Androz2091/discord-backup

📩 Installation

You can install @arnavk-09/discord-backups using npm:

npm install @arnavk-09/discord-backups 

✍️ Usage

To use this package first you have to import it

const { createBackup, loadBackup, bkupUtils } = require("@arnavk-09/discord-backups");

createBackup(guild, options)

The createBackup function creates a backup of the specified Discord guild. It returns a promise that resolves with the backup data. You can then save this data to a file or database for later use.

const backup = await createBackup(guild);

loadBackup(guild, backupData, options)

The loadBackup function restores a guild from a backup. It takes the guild object and backup data as parameters and returns a promise that resolves when the guild has been fully restored.

await loadBackup(guild, backupData);

🧪 Example

Here's an example of how to use discord-backups to create and load backups

const { Client, IntentsBitField } = require("discord.js");
const { createBackup, loadBackup, bkupUtils } = require("discord-backups");

const TOKEN = "your-discord-bot-token-here";

const client = new Client({
  intents: [
    IntentsBitField.Flags.GuildMessages,
    IntentsBitField.Flags.MessageContent,
    IntentsBitField.Flags.Guilds,
  ],
});

client.on("ready", () => {
  console.log(`Logged in as ${client.user.tag}`);
});

client.on("messageCreate", async (message) => {
  if (message.content === "!backup") {
    const backup = await createBackup(message.guild);
    console.log("backup data", backup);
  }

  if (message.content === "!load") {
    const backupData = /* load backup data from file or database */;
    await loadBackup(message.guild, backupData);
  }
});

client.login(TOKEN);

👏 Contributing

Contributions are welcome! Here are the steps to contribute:

  1. Fork the repository
  2. Clone your forked repository to your local machine or use github codespace
  3. Create a new branch for your changes: git checkout -b my-new-feature
  4. Make your changes & Format It npx prettier -w src
  5. And commit them: git commit -m 'Add some feature'
  6. Push your changes to your forked repository: git push origin my-new-feature
  7. Submit a pull request from your forked repository to the main repository
  8. Wait for feedback and approval

Please make sure your code follows the project's code style.

⭐ Star

If you find this package useful, please consider giving it a star on GitHub. It helps to boost our motivation and spread the word about this project. Thank you!