feature: emote adding, listing and removing

This commit is contained in:
skkeye
2023-11-02 22:54:08 -04:00
commit ecb0d624ab
11 changed files with 1643 additions and 0 deletions

28
commands/emotes/list.js Normal file
View File

@@ -0,0 +1,28 @@
const { SlashCommandBuilder } = require("discord.js");
module.exports = {
data: new SlashCommandBuilder()
.setName("listemotes")
.setDescription("Lists all emotes in the server."),
async execute(interaction) {
await interaction.reply("Fetching emotes...");
let replyMessage = "";
interaction.guild.emojis.fetch()
.then(emojis => {
// we need to make followup messages if the list is too long
let emoteList = "";
emojis.forEach(emoji => {
emoteList += `${emoji} - ${emoji.name}\n`;
if (emoteList.length > 1900) {
interaction.followUp(emoteList);
emoteList = "";
}
});
if (emoteList.length > 0) {
interaction.followUp(emoteList);
}
interaction.followUp("Total emotes: " + emojis.size + "\n");
})
.catch(console.error);
},
};