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