feat: now compatible with kubernetes and docker :3
This commit is contained in:
27
bot/commands/emotes/list.js
Normal file
27
bot/commands/emotes/list.js
Normal file
@@ -0,0 +1,27 @@
|
||||
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);
|
||||
},
|
||||
};
|
Reference in New Issue
Block a user