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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
import config from "@/config";
import { text } from "@/utils/components";
import { tsExact, tsRelative } from "@/utils/profile";
import {
type ChatInputCommandInteraction,
type Client,
ContainerBuilder,
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,
};
|