├── LICENSE ├── README.md ├── Stuctures └── legendJsClient.js ├── commands ├── emotes │ ├── add-these.js │ ├── add.js │ ├── big.js │ ├── list.js │ ├── remove.js │ ├── rename.js │ └── stats.js └── info │ └── help.js ├── config.json ├── index.js └── package.json /LICENSE: -------------------------------------------------------------------------------- 1 | NOTE 2 | 3 | Collaborator ( ZeroDiscord ) / alias. Zero [ Legal Associate - Contact ~ 0_0#6666 { Discord } ] alongwith the copyright holder have the discretion as to submit takedown requests upon any material that is possibly infringing 4 | the license holder's rights. This includes the following: 5 | - Commercial use 6 | - Modification & Distribution Under A Trademark Without Explicit Permit 7 | - Patent use 8 | - Warranty & Liability ( States The Code Owner Would Not Be Held Responsible In Cases of Unprecidented actions such as raids. ) 9 | All claims upon infringing material may route via DMCA Strikes 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Emote manager V2 2 | **[CREDITS]:** This bot was made by legendjs & ant. 3 | > **[UPDATE]:** Emote manager V2 is still not fully complete, Please Do not use the code untiil it's fully complete. 4 | 5 | **[NOTE]:** There are still errors to be fixed, so don't be surprised if you see any, they will all be fixed once it's complete 6 | ### Make sure you give proper credits. 7 | **[SUGGESTION (S)]:** 8 | - Star the repo 9 | - Fork the repo 10 | - Follow me to stay updated 11 | - Join [Developers Hub](https://discord.gg/avbmZBrDsk) for more 12 | -------------------------------------------------------------------------------- /Stuctures/legendJsClient.js: -------------------------------------------------------------------------------- 1 | const Discord = require('discord.js'); 2 | const { Client, Collection } = require('discord.js'); 3 | const { readdirSync } = require('fs'); 4 | const { prefix } = require('../config.json'); 5 | const commandsList = []; 6 | 7 | module.exports = class legendJsClient extends Client { 8 | constructor(options) { 9 | super(options); 10 | this.commands = new Collection(); 11 | } 12 | 13 | loadCommands() { 14 | const client = this; 15 | readdirSync('./Commands/').forEach(dir => { 16 | const commands = readdirSync(`./Commands/${dir}/`).filter(file => 17 | file.endsWith('.js') 18 | ); 19 | for (let file of commands) { 20 | let pull = require(`../Commands/${dir}/${file}`); 21 | if (['MESSAGE', 'USER'].includes(file.type)) delete file.description; 22 | commandsList.push(pull); 23 | if (pull.name) { 24 | client.commands.set(pull.name, pull); 25 | console.log(`[${pull.name.toUpperCase()}]: loaded!`); 26 | } else { 27 | console.log(`[${file.toUpperCase()}]: Error`); 28 | continue; 29 | } 30 | } 31 | client.on('ready', async () => { 32 | await client.guilds.cache 33 | .get('881460393430618152') 34 | .commands.set(commandsList); 35 | }); 36 | }); 37 | console.log('-------------------------------------'); 38 | console.log('[INFO]: Commands Loaded!'); 39 | } 40 | }; 41 | -------------------------------------------------------------------------------- /commands/emotes/add-these.js: -------------------------------------------------------------------------------- 1 | const {parse} = require("twemoji-parser"); 2 | const {Permissions, Util,} = require("discord.js"); 3 | 4 | module.exports = { 5 | name: 'addthese', 6 | description: 'Add multiple Emojis at once', 7 | options: [ 8 | { 9 | type: 'STRING', 10 | name: 'emojis', 11 | description: 'The Emojis you want to add', 12 | required: true 13 | } 14 | ], 15 | type: 'CHAT_INPUT', 16 | run: async (client, interaction, args) => { 17 | let emoji; 18 | let Link; 19 | if (!interaction.member.permissions.has(Permissions.FLAGS.MANAGE_EMOJIS)) { 20 | return interaction.followUp(`:x: | **You don't have the required permissions to use this command**`) 21 | } 22 | const emojis = args.join(" ").match(/?/gi) 23 | if (!emojis) return interaction.followUp(`:x: | **No emojis found in the arguments provided**`); 24 | 25 | emojis.forEach((emote, i) => { 26 | setTimeout(function () { 27 | emoji = Util.parseEmoji(emote); 28 | if (emoji.id) { 29 | Link = `https://cdn.discordapp.com/emojis/${ 30 | emoji.id 31 | }.${ 32 | emoji.animated ? "gif" : "png" 33 | }` 34 | interaction.guild.emojis.create(`${Link}`, `${`${ 35 | emoji.name 36 | }` 37 | }`).then(em => interaction.followUp({ 38 | content: em.toString() + " added!" 39 | })).catch(error => { 40 | if (error.code == "30008") { 41 | return interaction.followUp({ content: ":x: Max emoji slots used."}); 42 | } 43 | interaction.followUp(`:x: | an Error ocurred, error code: ${ 44 | error.code 45 | }`) 46 | }) 47 | 48 | } 49 | }, (i + 1) * 1000) 50 | }) 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /commands/emotes/add.js: -------------------------------------------------------------------------------- 1 | const {parse} = require("twemoji-parser"); 2 | const {Permissions, Util} = require("discord.js"); 3 | const isUrl = require("is-url"); 4 | 5 | module.exports = { 6 | name: "add", 7 | description: "Add an Emoji to the server", 8 | options: [ 9 | { 10 | name: "emoji", 11 | type: "STRING", 12 | description: "The emoji", 13 | required: true 14 | } 15 | ], 16 | type: "CHAT_INPUT", 17 | run: async (client, interaction, args) => { 18 | let emoji; 19 | let link; 20 | let type = ""; 21 | let EmojiName = ""; 22 | if (!interaction.member.permissions.has(Permissions.FLAGS.MANAGE_EMOJIS)) { 23 | return interaction.followUp(`:x: | **You don't have the required permissions to use this command**`) 24 | } 25 | let emote = args.join(" ").match(/?/gi); 26 | 27 | if (emote) { 28 | emote = emote[0]; 29 | type = "emoji"; 30 | EmojiName = args.join(" ").replace(/?/gi, "").trim().split(" ")[0]; 31 | } else { 32 | emote = `${ 33 | args.find(arg => isUrl(arg)) 34 | }` 35 | EmojiName = args.find(arg => arg != emote); 36 | type = "url"; 37 | } 38 | emoji = { 39 | name: "" 40 | }; 41 | if (type == "emoji") { 42 | emoji = Util.parseEmoji(emote); 43 | link = `https://cdn.discordapp.com/emojis/${ 44 | emoji.id 45 | }.${ 46 | emoji.animated ? "gif" : "png" 47 | }` 48 | } else { 49 | if (!EmojiName) 50 | return interaction.followUp({content: ":x: **Please provide a name!**" }); 51 | link = emote; 52 | } 53 | interaction.guild.emojis.create(`${link}`, 54 | `${ 55 | `${ 56 | EmojiName || emoji.name 57 | }` 58 | }`).then(em => interaction.followUp({ content: em.toString() + " added!" })).catch(error => { 59 | if (error.code == 30008) { 60 | return interaction.followUp({content:":x: **Max Emoji slots reached.**"}) 61 | } 62 | return interaction.followUp(`:x: | an Error occured, Error code: ${error.code}`); 63 | }) 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /commands/emotes/big.js: -------------------------------------------------------------------------------- 1 | const {Util} = require("discord.js"); 2 | module.exports = { 3 | name: "big", 4 | description: "Enlarge an emoji", 5 | options: [ 6 | { 7 | name: "emoji", 8 | type: "STRING", 9 | description: "The emoji to enlarge", 10 | required: true 11 | } 12 | ], 13 | type: "CHAT_INPUT", 14 | run: async (client, interaction, args) => { 15 | if (!args[0]) 16 | return interaction.followUp({content: ":x: **Emote is a required argument that is missing.**"}); 17 | 18 | const emo = Util.parseEmoji(args[0]); 19 | if (! emo.name || ! emo.id) 20 | return interaction.followUp({content: "Invalid emote argument"}); 21 | 22 | const res = `${ 23 | emo.name 24 | }: https://cdn.discordapp.com/emojis/${ 25 | emo.id 26 | }.${ 27 | emo.animated ? "gif" : "png" 28 | }`; 29 | interaction.followUp({content: res}); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /commands/emotes/list.js: -------------------------------------------------------------------------------- 1 | const { 2 | MessageButton, 3 | MessageActionRow, 4 | MessageEmbed, 5 | Permissions, 6 | Util 7 | } = require("discord.js"); 8 | 9 | module.exports = { 10 | name: "list", 11 | description: "Shows a list of the Emojis in this Server", 12 | type: "CHAT_INPUT", 13 | run: async (client, interaction, args) => { 14 | let list = []; 15 | let emojis = []; 16 | interaction.guild.emojis.cache.forEach(x => emojis.push(x)); 17 | if (emojis.size === 0) 18 | return interaction.followUp({content: "There are no emojis in this server"}); 19 | 20 | 21 | emojis = emojis.map((e, i) => `${ 22 | i + 1 23 | }. ${e} \\${e}`); 24 | for (var i = 0; i < emojis.length; i += 10) { 25 | const items = emojis.slice(i, i + 10); 26 | list.push(items.join("\n")); 27 | } 28 | let page = 0; 29 | let button1 = new MessageButton().setEmoji("⬅️").setStyle("PRIMARY").setCustomId("previous"); 30 | let button2 = new MessageButton().setEmoji("⏹").setStyle("DANGER").setCustomId("stop"); 31 | let button3 = new MessageButton().setEmoji("➡️").setStyle("PRIMARY").setCustomId("next"); 32 | let buttons = new MessageActionRow().addComponents([button1, button2, button3]); 33 | refreshButtons(button1, button2, button3); 34 | let e = new MessageEmbed().setDescription(list[page]).setFooter({ 35 | text: `Page ${ 36 | page + 1 37 | } of ${ 38 | list.length 39 | } (${ 40 | emojis.length 41 | } entries)` 42 | }).setColor("YELLOW"); 43 | const msg = await interaction.followUp({embeds: [e], components: [buttons]}); 44 | let doing = true; 45 | while (doing) { 46 | let r; 47 | const filter = function (button) { 48 | if (button.user !== interaction.user) 49 | return button.deferUpdate(); 50 | 51 | return ["previous", "stop", "next"].includes(button.customId) && button.user === interaction.user; 52 | }; 53 | try { 54 | r = await msg.awaitMessageComponent({filter, max: 1, time: 20000, errors: ["time"]}) 55 | } catch (error) { 56 | return interaction.followUp("Command timed out.") 57 | } 58 | const u = interaction.user; 59 | if (r.customId == "next") { 60 | page++; 61 | r.deferUpdate(); 62 | let newEmbed = new MessageEmbed().setDescription(list[page]).setFooter({ 63 | text: `Page ${ 64 | page + 1 65 | } of ${ 66 | list.length 67 | } (${ 68 | emojis.length 69 | } entries)` 70 | }).setColor("YELLOW"); 71 | msg.edit({embeds: [newEmbed], components: [buttons]}); 72 | } else if (r.customId == "previous") { 73 | page--; 74 | r.deferUpdate() && refreshButtons(button1, button2, button3) 75 | let newEmbed = new Discord.MessageEmbed().setDescription(list[page]).setFooter(`Page ${ 76 | page + 1 77 | } of ${ 78 | list.length 79 | } (${ 80 | emojis.length 81 | } entries)`).setColor("YELLOW"); 82 | msg.edit(newEmbed); 83 | } else if (r.customId == "stop") { 84 | button1.setDisabled(true) && button2.setDisabled(true) && button3.setDisabled(true) 85 | return; 86 | } 87 | } 88 | 89 | function refreshButtons(button1, button2, button3) { 90 | if (! list[page - 1]) 91 | button1.setDisabled(true); 92 | else if (! list[page + 1]) 93 | button3.setDisabled(true); 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /commands/emotes/remove.js: -------------------------------------------------------------------------------- 1 | const Discord = require('discord.js') 2 | 3 | module.exports = { 4 | name: "remove", 5 | description: "Remove an emoji from the server", 6 | options: [ 7 | { 8 | name: "emoji", 9 | description: "The emoji you want to remove", 10 | type: "STRING", 11 | required: true 12 | } 13 | ], 14 | type: "CHAT_INPUT", 15 | run: async (client, interaction, args) => { 16 | if (!interaction.member.permissions.has(Permissions.FLAGS.MANAGE_EMOJIS)) { 17 | return interaction.followUp({ content: `:x: | **You don't have Permission permissions to use this Command**` }) 18 | } 19 | if (!interaction.guild.me.permissions.has(Permissions.FLAGS.MANAGE_EMOJIS)) { 20 | return interaction.followUp({ content: `:x: | **I don't have permission to Manage Emojis**` }) 21 | } 22 | let emo = args[0].match(/(?<=?)/gi)[0] 23 | if (!emo) return interaction.followUp({ content: ":x: | **Emote is a required argument that is missing.**" }) 24 | if (interaction.guild.emojis.cache.get(emo)) { 25 | emo = interaction.guild.emojis.cache.get(emo) 26 | } else { 27 | return interaction.followUp({ content: ":x: | **Emoji not found**" }) 28 | } 29 | if (!emo.name || !emo.id) return interaction.followUp({ content: ":x: | **Invalid emote argument**" }); 30 | try { 31 | emo.delete() 32 | interaction.followUp({ content: "**The Emoji has been removed**" }) 33 | } catch (err) { 34 | interaction.followUp({ content: ":x: | **An Error occured**" }) 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /commands/emotes/rename.js: -------------------------------------------------------------------------------- 1 | const Discord = require('discord.js') 2 | const { MessageEmbed } = require("discord.js"); 3 | 4 | module.exports = { 5 | name: "rename", 6 | run: async (client, message, args) => { 7 | if (!message.member.hasPermission("MANAGE_EMOJIS")) { 8 | return message.channel.send(`:x: | **You Don't Have Permission To Use This Command**`) 9 | } 10 | if (!message.guild.me.hasPermission("MANAGE_EMOJIS")) { 11 | return message.channel.send(`:x: | **I Don't Have Permission To manage emojis**`) 12 | } 13 | if (!args[0]) return message.channel.send("emote is a required argument that is missing."); 14 | if (!args[1]) return message.channel.send("name is a required argument that is missing.") 15 | let emo = args[0].match(/(?<=?)/gi)[0] 16 | if (!emo) return message.channel.send("emote is a required argument that is missing.") 17 | if (message.guild.emojis.cache.get(emo)) { 18 | emo = message.guild.emojis.cache.get(emo) 19 | } else { 20 | return message.channel.send(":x: | Emoji not found") 21 | } 22 | if (!emo.name || !emo.id) return message.channel.send("Invalid emote argument"); 23 | console.log(emo) 24 | try { 25 | emo.setName(args.slice(1).join("_")) 26 | message.channel.send("**The name for the emoji has been changed to " + args.slice(1).join("_") + "**") 27 | } catch (err) { 28 | message.channel.send(":x: | **An Error occured**") 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /commands/emotes/stats.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: "stats", 3 | description: "Emoji stats for the server", 4 | type: "CHAT_INPUT", 5 | run: async (client, interaction, args) => { 6 | const config = [100, 200, 300, 500]; 7 | let emo; 8 | if (interaction.guild.premiumSubscriptionCount == 0) 9 | emo = config[0]; 10 | else if (interaction.guild.premiumSubscriptionCount >= 2 && interaction.guild.premiumSubscriptionCount < 7) 11 | emo = config[1]; 12 | else if (interaction.guild.premiumSubscriptionCount >= 7 && interaction.guild.premiumSubscriptionCount < 14) 13 | emo = config[2]; 14 | else if (interaction.guild.premiumSubscriptionCount >= 14) 15 | emo = config[3]; 16 | 17 | const staticEmojis = `**${ 18 | interaction.guild.emojis.cache.filter(e => !e.animated).size 19 | } / ${ 20 | emo / 2 21 | }** (${ 22 | emo / 2 - interaction.guild.emojis.cache.filter(e => !e.animated).size 23 | } left, ${ 24 | Number((interaction.guild.emojis.cache.filter(e => !e.animated).size / emo / 2) * 100).toFixed(2) 25 | }% full)`; 26 | const aniEmojis = `**${ 27 | interaction.guild.emojis.cache.filter(e => e.animated).size 28 | } / ${ 29 | emo / 2 30 | }** (${ 31 | emo / 2 - interaction.guild.emojis.cache.filter(e => e.animated).size 32 | } left, ${ 33 | Number((interaction.guild.emojis.cache.filter(e => e.animated).size / emo / 2) * 100).toFixed(2) 34 | }% full)`; 35 | const totEmojis = `**${ 36 | interaction.guild.emojis.cache.size 37 | } / ${emo}** (${ 38 | emo - interaction.guild.emojis.cache.size 39 | } left, ${ 40 | Number((interaction.guild.emojis.cache.size / emo) * 100).toFixed(2) 41 | }% full)`; 42 | const stati = `Static emotes: ${staticEmojis}`; 43 | const ani = `Animated emotes: ${aniEmojis}`; 44 | const tot = `Total: ${totEmojis}`; 45 | const res = `${stati}\n${ani}\n${tot}`; 46 | interaction.followUp({content: res}); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /commands/info/help.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require('discord.js'); 2 | const { prefix } = require('../../config.json'); 3 | module.exports = { 4 | name: 'help', 5 | run: async (client, message, args) => { 6 | let embed = new MessageEmbed() 7 | .setTitle(client.user.username + ' | Help') 8 | .setColor('RANDOM') 9 | .setFooter( 10 | message.guild.name + ' | made by legendjs#0001 & ant#0768', 11 | message.guild.iconURL() 12 | ) 13 | .setDescription( 14 | `My main Prefix is: \`${prefix}\`, The Commands are listed below:` 15 | ) 16 | .addField( 17 | 'Emoji Backup', 18 | '`backup-create` | `backup-delete` | `backup-list` | `backup-load`' 19 | ) 20 | .addField( 21 | 'Emoji', 22 | '`add-these` | `add` | `big` | `list` | `remove` | `rename` | `stats`' 23 | ) 24 | .setThumbnail(client.user.displayAvatarURL({ dynamic: true })); 25 | message.channel.send({ embed: embed }); 26 | } 27 | }; 28 | -------------------------------------------------------------------------------- /config.json: -------------------------------------------------------------------------------- 1 | { 2 | "prefix":"em/", 3 | "token":"token here" 4 | } 5 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | const Client = require('./Stuructures/legendJsClient'); 2 | const Discord = require('discord.js'); 3 | const {token} = require('./config.json'); 4 | const client = new Client({intents: 32767}); 5 | 6 | client.loadCommands(); 7 | console.log('-------------------------------------'); 8 | console.log('[CREDITS]: made by legend-js | https://github.com/legend-js-dev | legendjs#0001'); 9 | console.log('-------------------------------------'); 10 | 11 | client.on('ready', () => { 12 | console.log(`[INFO]: Ready on client (${ 13 | client.user.tag 14 | })`); 15 | console.log(`[INFO]: watching ${ 16 | client.guilds.cache.size 17 | } Servers, ${ 18 | client.channels.cache.size 19 | } channels & ${ 20 | client.users.cache.size 21 | } users`); 22 | console.log('-------------------------------------'); 23 | client.user.setActivity('you', {type: 'WATCHING'}); 24 | }); 25 | 26 | client.on('interactionCreate', async interaction => { 27 | if (interaction.isCommand()) { 28 | const cmd = client.commands.get(interaction.commandName); 29 | if (!cmd) return interaction.followUp({ content: ':x: | **an Unexpected Error Ocurred**' }); 30 | 31 | await interaction.deferReply({ 32 | ephemeral: cmd.ephemeral ? true : false 33 | }).catch(() => {}); 34 | 35 | const args = []; 36 | 37 | for (let option of interaction.options.data) { 38 | if (option.type === 'SUB_COMMAND') { 39 | if (option.name) 40 | args.push(option.name); 41 | 42 | option.options ?. forEach(x => { 43 | if (x.value) 44 | args.push(x.value); 45 | 46 | }); 47 | } else if (option.value) 48 | args.push(option.value); 49 | 50 | } 51 | interaction.member = interaction.guild.members.cache.get(interaction.user.id); 52 | 53 | cmd.run(client, interaction, args); 54 | } 55 | }); 56 | 57 | client.login(token); 58 | 59 | process.on('unhandledRejection', (reason, p) => { 60 | console.log('Unhandled Rejection at:', p, 'reason:', reason); 61 | }); 62 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "discord.js": "^13.6.0", 4 | "is-url": "^1.2.4", 5 | "twemoji-parser": "^13.1.0" 6 | } 7 | } 8 | --------------------------------------------------------------------------------