Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

discord.emoji-backup

1.0.2 • Public • Published

Discord

Discord Emoji Backup

A simple package to make your emoji easier to handle.

Made by ShimaHaucks#2469
Join our Discord server, Click here!
NPM package

Installation:

$ npm install -s discord-emoji-backup

Usage:

const { EmojiBackup } = require('discord-emoji-backup');
const backup = new EmojiBackup();
const { Client } = require('discord.js');
const client = new Client();
 
client.on('ready', () => { console.log('Ready!'); });
client.on('message', async msg => {
    if (msg.author.bot || !msg.guild) return;
    if (!msg.content.startsWith('!')) return;
    const args = msg.content.slice('!'.length).trim().split(/ +/g);
    const command = args.shift().toLowerCase();
    if (command === 'create') {
        // Create a backup
        await backup.create(msg.guild).then(console.log);
    }
    if (command === 'load-nodelete') {
        // Load a backup without deleting all emojis
        const backupid = args.join(' ');
        await backup.load(msg.guild, backupid);
    }
    if (command === 'load-delete') {
        // Load a backup with deleting all emojis
        const backupid = args.join(' ');
        await backup.load(msg.guild, backupid, { deleteAll: true });
    }
    if (command === 'list') {
        // List all of backups
        const list = await backup.list();
        console.log(list);
    }
});

Install

npm i discord.emoji-backup

DownloadsWeekly Downloads

4

Version

1.0.2

License

MIT

Unpacked Size

9.48 kB

Total Files

7

Last publish

Collaborators

  • avatar