discord.emoji-backup
v1.0.2
Published
A simple package to make your emoji easier to handle.
Downloads
51
Maintainers
Readme
Discord Emoji Backup
A simple package to make your emoji easier to handle.
Made by ShimaHaucks#2469
Join our Discord server, Click here!
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);
}
});