Moved all db logic to db functions

This commit is contained in:
2024-10-25 19:52:34 +02:00
parent d206703098
commit f2aa84f8a5
28 changed files with 244 additions and 73 deletions

View File

@@ -1,5 +1,6 @@
import { InteractionContextType, PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js"
import db from "src/drizzle/db.js"
import { getVerify } from "src/drizzle/functions"
import { devMessage, embedColor } from "~/config/options.js"
import { ICommand } from "~/interfaces"
import { getHeadURL, getIGN, getUUID } from "~/utils/Hypixel.js"
@@ -37,9 +38,7 @@ export default {
return
}
const verifyData = await db.query.verifies.findFirst({
where: ({ uuid: uuidfromdb }, { eq }) => eq(uuidfromdb, uuid)
})
const verifyData = await getVerify({ uuid })
if (!verifyData) {
await interaction.editReply({
embeds: [{