import { option } from "@purrkit/router"; import { editActor } from "@stealth-developers/db"; import { errorMessage, upsertUser } from "@/lib"; import { useGetData } from "@/middleware"; import { uwuify } from "./lib"; const uwuifyGroup = useGetData.command("uwuify", { description: "uwuify-wewated commands :3", }); uwuifyGroup.subcommand("toggle", { description: "toggwe uwuify OwO on ow off", options: { user: option.user("t-the usew to toggle uwuify OwO fow", { required: false }), }, async run(interaction, { user: target }, { actor }) { if (target && !actor?.moderator) return errorMessage(interaction, "you must be a modewatow to toggle uwuify OwO fow othews."); if (!interaction.guild) return errorMessage(interaction, "this c-c-command can onwy be used in a sewvew."); const uwuifyActor = target ? (await upsertUser(target, interaction.guild))?.actor : actor; if (!uwuifyActor) return errorMessage(interaction, "failed to find youw usew data."); const isEnabled = uwuifyActor.uwuify; await editActor(uwuifyActor.id, { uwuify: !uwuifyActor.uwuify, }); const resultString = `uwuify is now ${!isEnabled ? "enabled" : "disabled"} for ${target ? target.displayName : "you"}.`; return interaction.reply({ content: uwuify(resultString), flags: ["Ephemeral"], }); }, }); export const uwuifyCommands = [uwuifyGroup];