import { kitten } from "@/client"; import { upsertUser } from "@/lib"; import { HaltExecution } from "@purrkit/router"; const base = kitten.builder(); export const getDbActor = base.use(async (interaction) => { if (!interaction.guild) throw new HaltExecution("This command can only be run in a guild."); const actor = await upsertUser(interaction.user, interaction.guild); if (!actor) throw new HaltExecution("Failed to add you to the database. Please try again."); return actor; });