Finish moving from SQL to New Funny ORM

This commit is contained in:
Cadence Ember 2023-09-18 22:51:59 +12:00
parent 4e1e590c3a
commit 79bd0254f0
19 changed files with 87 additions and 87 deletions

View file

@ -6,7 +6,7 @@ const assert = require("assert").strict
const {PNG} = require("pngjs")
const passthrough = require("../../passthrough")
const { sync, db, discord } = passthrough
const {sync, db, discord, select} = passthrough
/** @type {import("../../matrix/file")} */
const file = sync.require("../../matrix/file")
//** @type {import("../../matrix/mreq")} */
@ -38,7 +38,7 @@ const Rlottie = (async () => {
* @returns {Promise<{mxc: string, info: typeof INFO}>}
*/
async function convert(stickerItem) {
const existingMxc = db.prepare("SELECT mxc FROM lottie WHERE id = ?").pluck().get(stickerItem.id)
const existingMxc = select("lottie", "mxc", "WHERE id = ?").pluck().get(stickerItem.id)
if (existingMxc) return {mxc: existingMxc, info: INFO}
const r = await Rlottie
const res = await fetch(file.DISCORD_IMAGES_BASE + file.sticker(stickerItem))