src/interactions/commands/uwuify.ts (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
import { type ChatInputCommandInteraction, type Client, SlashCommandBuilder } from "discord.js";
import Uwuifier from "uwuifier";
const commandData = new SlashCommandBuilder()
.setName("uwuify")
.setDescription("ok")
.addStringOption((option) =>
option.setName("text").setDescription("The text to uwuify").setRequired(true),
);
async function execute(_client: Client, interaction: ChatInputCommandInteraction) {
const uwuifier = new Uwuifier();
const text = interaction.options.getString("text", true);
const uwuifiedText = uwuifier.uwuifySentence(text);
const blacklistedWords = ["twerks", "sees bulge", "notices buldge", "starts twerking"];
const finalText = blacklistedWords.reduce((acc, word) => {
return acc.replace(new RegExp(word, "gi"), "----");
}, uwuifiedText);
await interaction.reply({
content: finalText,
allowedMentions: { users: [interaction.user.id] },
});
}
export default {
data: commandData,
execute,
};
|