bot,db: we're bringing uwuify BACK
vi did:web:vt3e.cat
Wed, 08 Jul 2026 01:39:12 +0100
9 files changed,
2031 insertions(+),
1 deletions(-)
jump to
M
apps/bot/package.json
→
apps/bot/package.json
@@ -22,7 +22,8 @@ "fastest-levenshtein": "^1.0.16",
"pino": "^10.3.1", "pino-pretty": "^13.1.3", "sharp-phash": "^2.2.0", - "tesseract.js": "^7.0.0" + "tesseract.js": "^7.0.0", + "uwuifier": "^4.2.2" }, "devDependencies": { "@sapphire/cli": "^1.9.3",
M
apps/bot/src/events/index.ts
→
apps/bot/src/events/index.ts
@@ -1,4 +1,5 @@
import "f/automod/listeners"; +import "f/uwuify/listeners"; import { upsertGuildActor } from "f/guild-actor"; import { client } from "@/client";
M
apps/bot/src/feats/index.ts
→
apps/bot/src/feats/index.ts
@@ -3,12 +3,14 @@ import { syncCommand } from "./link";
import { miscCommands } from "./misc"; import { robloxCommands } from "./roblox"; import { ticketCommands, ticketComponents } from "./tickets"; +import { uwuifyCommands } from "./uwuify"; export const commands = [ ...ticketCommands, ...miscCommands, ...bugCommands, ...robloxCommands, + ...uwuifyCommands, syncCommand, ]; export const components = [...ticketComponents, ...bugComponents];
A
apps/bot/src/feats/uwuify/index.ts
@@ -0,0 +1,41 @@
+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];
A
apps/bot/src/feats/uwuify/lib.ts
@@ -0,0 +1,12 @@
+import Uwuifier from "uwuifier"; + +export function uwuify(input: string) { + const uwuifier = new Uwuifier(); + const uwuifiedContent = input ? uwuifier.uwuifySentence(input) : ""; + + const blacklistedWords = ["twerks", "sees bulge", "notices buldge", "starts twerking", "wank"]; + + return blacklistedWords.reduce((acc, word) => { + return acc.replace(new RegExp(word, "gi"), "mrrp"); + }, uwuifiedContent); +}
A
apps/bot/src/feats/uwuify/listeners.ts
@@ -0,0 +1,68 @@
+import { getActorByDiscordIdAndGuildDiscordId } from "@stealth-developers/db"; +import { + AttachmentBuilder, + ChannelType, + Events, + type MessageCreateOptions, + type ReplyOptions, +} from "discord.js"; + +import { client } from "@/client"; +import { createScoped } from "@/lib"; + +import { uwuify } from "./lib"; + +const logger = createScoped("uwuify"); + +client.on(Events.MessageCreate, async (message) => { + if (message.author.bot) return; + if (message.channel.type !== ChannelType.GuildText) return; + if (message.channel.name.includes("ticket")) return; + if (!message.guildId) return; + if (!message.channel.isSendable()) return; + + const actor = await getActorByDiscordIdAndGuildDiscordId(message.author.id, message.guildId); + if (!actor?.uwuify) return; + + let replyReference: ReplyOptions | undefined = undefined; + if (message.reference?.messageId) { + try { + replyReference = { + messageReference: await message.channel.messages.fetch(message.reference.messageId), + failIfNotExists: false, + }; + } catch (error) { + logger.warn(error, "Failed to fetch referenced message for uwuified reply"); + } + } + + const files: AttachmentBuilder[] = []; + for (const attachment of message.attachments.values()) { + try { + const resp = await fetch(attachment.url); + if (!resp.ok) { + logger.warn(`Failed to fetch attachment ${attachment.name}, status ${resp.status}`); + continue; + } + + const buffer = await resp.arrayBuffer(); + const attachmentBuilder = new AttachmentBuilder(Buffer.from(buffer), { + name: attachment.name, + }); + files.push(attachmentBuilder); + } catch (error) { + logger.error(error, `Failed to download attachment ${attachment.name}`); + } + } + + const sendOptions: MessageCreateOptions = { + content: `**<@${message.author.id}>**: ${uwuify(message.content)}`, + files: files, + reply: replyReference, + allowedMentions: { parse: [] }, + }; + + Promise.all([message.delete(), message.channel.send(sendOptions)]).catch((error) => { + logger.error(error, "Failed to send uwuified message"); + }); +});
A
pkgs/db/drizzle/20260708003216_third_lyja/migration.sql
@@ -0,0 +1,1 @@
+ALTER TABLE `actors` ADD `uwuify` integer DEFAULT false NOT NULL;
A
pkgs/db/drizzle/20260708003216_third_lyja/snapshot.json
@@ -0,0 +1,1903 @@
+{ + "version": "7", + "dialect": "sqlite", + "id": "ce2b7818-89f4-474c-a61c-c4620e9dfe0a", + "prevIds": [ + "a0e224cf-20bb-46bc-b839-2442ac13a5dd" + ], + "ddl": [ + { + "name": "api_tokens", + "entityType": "tables" + }, + { + "name": "sessions", + "entityType": "tables" + }, + { + "name": "users", + "entityType": "tables" + }, + { + "name": "actors", + "entityType": "tables" + }, + { + "name": "guilds", + "entityType": "tables" + }, + { + "name": "ticket_attachments", + "entityType": "tables" + }, + { + "name": "ticket_comments", + "entityType": "tables" + }, + { + "name": "ticket_messages", + "entityType": "tables" + }, + { + "name": "ticket_participants", + "entityType": "tables" + }, + { + "name": "tickets", + "entityType": "tables" + }, + { + "name": "bugs", + "entityType": "tables" + }, + { + "name": "image_hashes", + "entityType": "tables" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "api_tokens" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "token", + "entityType": "columns", + "table": "api_tokens" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "name", + "entityType": "columns", + "table": "api_tokens" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "created_at", + "entityType": "columns", + "table": "api_tokens" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "sessions" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "user_id", + "entityType": "columns", + "table": "sessions" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "access_token", + "entityType": "columns", + "table": "sessions" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "refresh_token", + "entityType": "columns", + "table": "sessions" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "scope", + "entityType": "columns", + "table": "sessions" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "token_type", + "entityType": "columns", + "table": "sessions" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "expires_at", + "entityType": "columns", + "table": "sessions" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "created_at", + "entityType": "columns", + "table": "sessions" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "users" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "discord_id", + "entityType": "columns", + "table": "users" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "display_name", + "entityType": "columns", + "table": "users" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "username", + "entityType": "columns", + "table": "users" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "avatar", + "entityType": "columns", + "table": "users" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "false", + "generated": null, + "name": "accepted_privacy_policy", + "entityType": "columns", + "table": "users" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "false", + "generated": null, + "name": "accepted_terms_of_service", + "entityType": "columns", + "table": "users" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "created_at", + "entityType": "columns", + "table": "users" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "updated_at", + "entityType": "columns", + "table": "users" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "actors" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "guild_id", + "entityType": "columns", + "table": "actors" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "user_id", + "entityType": "columns", + "table": "actors" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "discord_id", + "entityType": "columns", + "table": "actors" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "display_name", + "entityType": "columns", + "table": "actors" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "username", + "entityType": "columns", + "table": "actors" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "avatar", + "entityType": "columns", + "table": "actors" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "pin", + "entityType": "columns", + "table": "actors" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "pin_expires_in", + "entityType": "columns", + "table": "actors" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "roblox_id", + "entityType": "columns", + "table": "actors" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "moderator", + "entityType": "columns", + "table": "actors" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "false", + "generated": null, + "name": "uwuify", + "entityType": "columns", + "table": "actors" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "created_at", + "entityType": "columns", + "table": "actors" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "updated_at", + "entityType": "columns", + "table": "actors" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "deleted_at", + "entityType": "columns", + "table": "actors" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "guilds" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "discord_id", + "entityType": "columns", + "table": "guilds" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "name", + "entityType": "columns", + "table": "guilds" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "icon", + "entityType": "columns", + "table": "guilds" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "ticket_category", + "entityType": "columns", + "table": "guilds" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "ticket_log_channel", + "entityType": "columns", + "table": "guilds" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "ticket_greeting", + "entityType": "columns", + "table": "guilds" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "ticket_prompt_channel", + "entityType": "columns", + "table": "guilds" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "ticket_prompt", + "entityType": "columns", + "table": "guilds" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "moderator_role", + "entityType": "columns", + "table": "guilds" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "created_at", + "entityType": "columns", + "table": "guilds" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "updated_at", + "entityType": "columns", + "table": "guilds" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "ticket_attachments" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "message_id", + "entityType": "columns", + "table": "ticket_attachments" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "ticket_id", + "entityType": "columns", + "table": "ticket_attachments" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "actor_id", + "entityType": "columns", + "table": "ticket_attachments" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": "'watever'", + "generated": null, + "name": "key", + "entityType": "columns", + "table": "ticket_attachments" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "file_name", + "entityType": "columns", + "table": "ticket_attachments" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "file_type", + "entityType": "columns", + "table": "ticket_attachments" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "file_size", + "entityType": "columns", + "table": "ticket_attachments" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "ticket_comments" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "ticket_id", + "entityType": "columns", + "table": "ticket_comments" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "actor_id", + "entityType": "columns", + "table": "ticket_comments" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "content", + "entityType": "columns", + "table": "ticket_comments" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "created_at", + "entityType": "columns", + "table": "ticket_comments" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "updated_at", + "entityType": "columns", + "table": "ticket_comments" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "ticket_messages" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "message_id", + "entityType": "columns", + "table": "ticket_messages" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "ticket_id", + "entityType": "columns", + "table": "ticket_messages" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "actor_id", + "entityType": "columns", + "table": "ticket_messages" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "actor_role", + "entityType": "columns", + "table": "ticket_messages" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "false", + "generated": null, + "name": "is_private", + "entityType": "columns", + "table": "ticket_messages" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "content", + "entityType": "columns", + "table": "ticket_messages" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "embeds", + "entityType": "columns", + "table": "ticket_messages" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "components", + "entityType": "columns", + "table": "ticket_messages" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "created_at", + "entityType": "columns", + "table": "ticket_messages" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "edited_at", + "entityType": "columns", + "table": "ticket_messages" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "deleted_at", + "entityType": "columns", + "table": "ticket_messages" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "ticket_participants" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "ticket_id", + "entityType": "columns", + "table": "ticket_participants" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "actor_id", + "entityType": "columns", + "table": "ticket_participants" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "role", + "entityType": "columns", + "table": "ticket_participants" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "reason", + "entityType": "columns", + "table": "ticket_participants" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "created_at", + "entityType": "columns", + "table": "ticket_participants" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "tickets" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "guild_id", + "entityType": "columns", + "table": "tickets" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "local_id", + "entityType": "columns", + "table": "tickets" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "status", + "entityType": "columns", + "table": "tickets" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "channel_id", + "entityType": "columns", + "table": "tickets" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "thread_id", + "entityType": "columns", + "table": "tickets" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "close_reason", + "entityType": "columns", + "table": "tickets" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "private_reason", + "entityType": "columns", + "table": "tickets" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "opened_at", + "entityType": "columns", + "table": "tickets" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "closed_at", + "entityType": "columns", + "table": "tickets" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "closed_by", + "entityType": "columns", + "table": "tickets" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "last_subject_activity_at", + "entityType": "columns", + "table": "tickets" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "last_moderator_activity_at", + "entityType": "columns", + "table": "tickets" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "opened_by", + "entityType": "columns", + "table": "tickets" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "open_reason", + "entityType": "columns", + "table": "tickets" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "subject", + "entityType": "columns", + "table": "tickets" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "claimed_by", + "entityType": "columns", + "table": "tickets" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "claimed_at", + "entityType": "columns", + "table": "tickets" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "thanked_at", + "entityType": "columns", + "table": "tickets" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "warned_at", + "entityType": "columns", + "table": "tickets" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "last_message_at", + "entityType": "columns", + "table": "tickets" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "has_moderator_message", + "entityType": "columns", + "table": "tickets" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "has_author_message", + "entityType": "columns", + "table": "tickets" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": true, + "default": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "bugs" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "guild_id", + "entityType": "columns", + "table": "bugs" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "actor_id", + "entityType": "columns", + "table": "bugs" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "bug_number", + "entityType": "columns", + "table": "bugs" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "status", + "entityType": "columns", + "table": "bugs" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "title", + "entityType": "columns", + "table": "bugs" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "description", + "entityType": "columns", + "table": "bugs" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": "'[]'", + "generated": null, + "name": "affected_projects", + "entityType": "columns", + "table": "bugs" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "false", + "generated": null, + "name": "sent", + "entityType": "columns", + "table": "bugs" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "message_id", + "entityType": "columns", + "table": "bugs" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "thread_id", + "entityType": "columns", + "table": "bugs" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "(unixepoch())", + "generated": null, + "name": "created_at", + "entityType": "columns", + "table": "bugs" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "(unixepoch())", + "generated": null, + "name": "updated_at", + "entityType": "columns", + "table": "bugs" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "closed_at", + "entityType": "columns", + "table": "bugs" + }, + { + "type": "text", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "id", + "entityType": "columns", + "table": "image_hashes" + }, + { + "type": "text", + "notNull": true, + "autoincrement": false, + "default": null, + "generated": null, + "name": "hash", + "entityType": "columns", + "table": "image_hashes" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "first_seen", + "entityType": "columns", + "table": "image_hashes" + }, + { + "type": "integer", + "notNull": false, + "autoincrement": false, + "default": null, + "generated": null, + "name": "last_seen", + "entityType": "columns", + "table": "image_hashes" + }, + { + "type": "integer", + "notNull": true, + "autoincrement": false, + "default": "1", + "generated": null, + "name": "seen_times", + "entityType": "columns", + "table": "image_hashes" + }, + { + "columns": [ + "user_id" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "name": "fk_sessions_user_id_users_id_fk", + "entityType": "fks", + "table": "sessions" + }, + { + "columns": [ + "guild_id" + ], + "tableTo": "guilds", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "name": "fk_actors_guild_id_guilds_id_fk", + "entityType": "fks", + "table": "actors" + }, + { + "columns": [ + "user_id" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "name": "fk_actors_user_id_users_id_fk", + "entityType": "fks", + "table": "actors" + }, + { + "columns": [ + "message_id" + ], + "tableTo": "ticket_messages", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "name": "fk_ticket_attachments_message_id_ticket_messages_id_fk", + "entityType": "fks", + "table": "ticket_attachments" + }, + { + "columns": [ + "ticket_id" + ], + "tableTo": "tickets", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "name": "fk_ticket_attachments_ticket_id_tickets_id_fk", + "entityType": "fks", + "table": "ticket_attachments" + }, + { + "columns": [ + "actor_id" + ], + "tableTo": "actors", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "name": "fk_ticket_attachments_actor_id_actors_id_fk", + "entityType": "fks", + "table": "ticket_attachments" + }, + { + "columns": [ + "ticket_id" + ], + "tableTo": "tickets", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "name": "fk_ticket_comments_ticket_id_tickets_id_fk", + "entityType": "fks", + "table": "ticket_comments" + }, + { + "columns": [ + "actor_id" + ], + "tableTo": "actors", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "name": "fk_ticket_comments_actor_id_actors_id_fk", + "entityType": "fks", + "table": "ticket_comments" + }, + { + "columns": [ + "ticket_id" + ], + "tableTo": "tickets", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "name": "fk_ticket_messages_ticket_id_tickets_id_fk", + "entityType": "fks", + "table": "ticket_messages" + }, + { + "columns": [ + "actor_id" + ], + "tableTo": "actors", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "name": "fk_ticket_messages_actor_id_actors_id_fk", + "entityType": "fks", + "table": "ticket_messages" + }, + { + "columns": [ + "ticket_id" + ], + "tableTo": "tickets", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "name": "fk_ticket_participants_ticket_id_tickets_id_fk", + "entityType": "fks", + "table": "ticket_participants" + }, + { + "columns": [ + "actor_id" + ], + "tableTo": "actors", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "name": "fk_ticket_participants_actor_id_actors_id_fk", + "entityType": "fks", + "table": "ticket_participants" + }, + { + "columns": [ + "guild_id" + ], + "tableTo": "guilds", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "name": "fk_tickets_guild_id_guilds_id_fk", + "entityType": "fks", + "table": "tickets" + }, + { + "columns": [ + "closed_by" + ], + "tableTo": "actors", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "name": "fk_tickets_closed_by_actors_id_fk", + "entityType": "fks", + "table": "tickets" + }, + { + "columns": [ + "opened_by" + ], + "tableTo": "actors", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "name": "fk_tickets_opened_by_actors_id_fk", + "entityType": "fks", + "table": "tickets" + }, + { + "columns": [ + "subject" + ], + "tableTo": "actors", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "name": "fk_tickets_subject_actors_id_fk", + "entityType": "fks", + "table": "tickets" + }, + { + "columns": [ + "claimed_by" + ], + "tableTo": "actors", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "nameExplicit": false, + "name": "fk_tickets_claimed_by_actors_id_fk", + "entityType": "fks", + "table": "tickets" + }, + { + "columns": [ + "guild_id" + ], + "tableTo": "guilds", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "name": "fk_bugs_guild_id_guilds_id_fk", + "entityType": "fks", + "table": "bugs" + }, + { + "columns": [ + "actor_id" + ], + "tableTo": "actors", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "nameExplicit": false, + "name": "fk_bugs_actor_id_actors_id_fk", + "entityType": "fks", + "table": "bugs" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "api_tokens_pk", + "table": "api_tokens", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sessions_pk", + "table": "sessions", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "users_pk", + "table": "users", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "actors_pk", + "table": "actors", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "guilds_pk", + "table": "guilds", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "ticket_attachments_pk", + "table": "ticket_attachments", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "ticket_comments_pk", + "table": "ticket_comments", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "ticket_messages_pk", + "table": "ticket_messages", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "ticket_participants_pk", + "table": "ticket_participants", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "tickets_pk", + "table": "tickets", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "bugs_pk", + "table": "bugs", + "entityType": "pks" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "image_hashes_pk", + "table": "image_hashes", + "entityType": "pks" + }, + { + "columns": [ + { + "value": "guild_id", + "isExpression": false + }, + { + "value": "user_id", + "isExpression": false + } + ], + "isUnique": true, + "where": null, + "origin": "manual", + "name": "actors_guild_user_idx", + "entityType": "indexes", + "table": "actors" + }, + { + "columns": [ + { + "value": "ticket_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "name": "ticket_attachments_ticket_idx", + "entityType": "indexes", + "table": "ticket_attachments" + }, + { + "columns": [ + { + "value": "actor_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "name": "ticket_attachments_actor_idx", + "entityType": "indexes", + "table": "ticket_attachments" + }, + { + "columns": [ + { + "value": "id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "name": "ticket_attachments_public_id_idx", + "entityType": "indexes", + "table": "ticket_attachments" + }, + { + "columns": [ + { + "value": "key", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "name": "ticket_attachments_key_idx", + "entityType": "indexes", + "table": "ticket_attachments" + }, + { + "columns": [ + { + "value": "ticket_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "name": "ticket_comments_ticket_idx", + "entityType": "indexes", + "table": "ticket_comments" + }, + { + "columns": [ + { + "value": "actor_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "name": "ticket_comments_actor_idx", + "entityType": "indexes", + "table": "ticket_comments" + }, + { + "columns": [ + { + "value": "ticket_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "name": "ticket_messages_ticket_idx", + "entityType": "indexes", + "table": "ticket_messages" + }, + { + "columns": [ + { + "value": "actor_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "name": "ticket_messages_actor_idx", + "entityType": "indexes", + "table": "ticket_messages" + }, + { + "columns": [ + { + "value": "id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "name": "ticket_messages_public_id_idx", + "entityType": "indexes", + "table": "ticket_messages" + }, + { + "columns": [ + { + "value": "ticket_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "name": "ticket_participants_ticket_idx", + "entityType": "indexes", + "table": "ticket_participants" + }, + { + "columns": [ + { + "value": "actor_id", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "name": "ticket_participants_actor_idx", + "entityType": "indexes", + "table": "ticket_participants" + }, + { + "columns": [ + { + "value": "role", + "isExpression": false + } + ], + "isUnique": false, + "where": null, + "origin": "manual", + "name": "ticket_participants_role_idx", + "entityType": "indexes", + "table": "ticket_participants" + }, + { + "columns": [ + { + "value": "guild_id", + "isExpression": false + }, + { + "value": "local_id", + "isExpression": false + } + ], + "isUnique": true, + "where": null, + "origin": "manual", + "name": "tickets_guild_local_idx", + "entityType": "indexes", + "table": "tickets" + }, + { + "columns": [ + "discord_id" + ], + "nameExplicit": false, + "name": "users_discord_id_unique", + "entityType": "uniques", + "table": "users" + }, + { + "columns": [ + "discord_id" + ], + "nameExplicit": false, + "name": "guilds_discord_id_unique", + "entityType": "uniques", + "table": "guilds" + }, + { + "columns": [ + "hash" + ], + "nameExplicit": false, + "name": "image_hashes_hash_unique", + "entityType": "uniques", + "table": "image_hashes" + } + ], + "renames": [] +}
M
pkgs/db/src/schemas/actors.ts
→
pkgs/db/src/schemas/actors.ts
@@ -27,6 +27,7 @@ pinExpiresIn: s.integer("pin_expires_in", { mode: "timestamp" }),
robloxId: s.text("roblox_id"), moderator: s.integer("moderator", { mode: "boolean" }), + uwuify: s.integer("uwuify", { mode: "boolean" }).default(false).notNull(), createdAt: s.integer("created_at", { mode: "timestamp" }).notNull(), updatedAt: s.integer("updated_at", { mode: "timestamp" }).notNull(),