Asleep
Asleep
Explore posts from servers
CCarbon
Created by Asleep on 9/17/2024 in #📌support
TypeError when importing any command or Client
Hey. When I import either of these 2 classes, I get this error.
import { Client, ClientMode } from "@buape/carbon"
import CommandHandler from "~/server/discord/handler";
import { Client, ClientMode } from "@buape/carbon"
import CommandHandler from "~/server/discord/handler";
TypeError: Cannot read properties of undefined (reading 'Base') This is the contents of handler.ts:
import { Command, type CommandInteraction } from "@buape/carbon";
import { db } from "~/server/db";

export default class CommandHandler extends Command {
name = "*"
description = "CarbonCraft Command Handler"
defer = false

async run(interaction: CommandInteraction) {
const command = await db.command.findFirst({
where: {
botId: interaction.client.options.clientId,
name: interaction.rawData.data.name
}
})
return interaction.reply({
content: command?.response
})
}
}
import { Command, type CommandInteraction } from "@buape/carbon";
import { db } from "~/server/db";

export default class CommandHandler extends Command {
name = "*"
description = "CarbonCraft Command Handler"
defer = false

async run(interaction: CommandInteraction) {
const command = await db.command.findFirst({
where: {
botId: interaction.client.options.clientId,
name: interaction.rawData.data.name
}
})
return interaction.reply({
content: command?.response
})
}
}
23 replies
PPrisma
Created by Asleep on 8/30/2024 in #help-and-questions
How can I disconnect a relation by using it's fields?
I need to disconnect a relation, but I cannot access the actual relation field due to the way it is setup. Let's say there is a relation called author, and I only have access to authorId, can I disconnect it by setting authorId to null/undefined?
3 replies