feat: now compatible with kubernetes and docker :3

This commit is contained in:
2024-01-12 20:40:15 -05:00
parent 88b9b5b8c6
commit ed3a533e6d
15 changed files with 15 additions and 12 deletions

29
bot/commands/emotes/rm.js Normal file
View File

@@ -0,0 +1,29 @@
const { SlashCommandBuilder } = require("discord.js");
module.exports = {
data: new SlashCommandBuilder()
.setName("rm")
.setDescription("Removes emotes from the server.")
.addStringOption(option =>
option.setName("emotes")
.setDescription("Emotes to remove.")
.setRequired(true)),
async execute(interaction) {
await interaction.reply("Removing emotes...");
// find every emote in the message and remove them
let emoteList = interaction.options.getString("emotes");
let emoteIdRegex = /<(?<animated>a?):(?<name>\w{0,22})\w*:(?<id>\d+)>/gm;
let replyMessage = "";
for (const match of emoteList.matchAll(emoteIdRegex)) {
let emote = interaction.guild.emojis.cache.find(emoji => emoji.id === match.groups.id);
if (emote) {
await emote.delete();
replyMessage += `Removed ${match[0]}!\n`;
} else {
replyMessage += `Could not find ${match[0]}!\n`;
}
interaction.editReply(replyMessage);
replyMessage = "";
}
},
};