Tenjaou
Tenjaou
Explore posts from servers
SIASapphire - Imagine a framework
Created by Tenjaou on 6/27/2024 in #sapphire-support
error: A compatible class export was not found.
My bad they were interaction-handlers and I had them in the folder meant fo listener's
7 replies
SIASapphire - Imagine a framework
Created by Tenjaou on 6/27/2024 in #sapphire-support
error: A compatible class export was not found.
1. 5.2.1 2.
src
├───commands
├───enums
├───interfaces
├───languages
│ └───en-US
├───listeners
└───structures
src
├───commands
├───enums
├───interfaces
├───languages
│ └───en-US
├───listeners
└───structures
3. No 4. "module": "src/index.ts" 5. Am using Bun 6. N/A
7 replies
SIASapphire - Imagine a framework
Created by Tenjaou on 6/27/2024 in #sapphire-support
error: A compatible class export was not found.
Error
Error when loading 'D:\old-drive\Source-Codes\Bots\TicketZ-bot\src\listeners\buttonHandler.ts': 9 | LoaderErrorType2["UnknownStore"] = "UNKNOWN_STORE";
10 | return LoaderErrorType2;
11 | })(LoaderErrorType || {});
12 | var _LoaderError = class _LoaderError extends Error {
13 | constructor(type, message) {
14 | super(message);
^
error: A compatible class export was not found. [D:\old-drive\Source-Codes\Bots\TicketZ-bot\src\listeners\buttonHandler.ts]
path: "D:\old-drive\Source-Codes\Bots\TicketZ-bot\src\listeners\buttonHandler.ts"
at new _LoaderError (D:\old-drive\Source-Codes\Bots\TicketZ-bot\node_modules\@sapphire\pieces\dist\esm\lib\errors\LoaderError.mjs:14:5)
at new _MissingExportsError (D:\old-drive\Source-Codes\Bots\TicketZ-bot\node_modules\@sapphire\pieces\dist\esm\lib\errors\MissingExportsError.mjs:6:5)
at D:\old-drive\Source-Codes\Bots\TicketZ-bot\node_modules\@sapphire\pieces\dist\esm\lib\strategies\LoaderStrategy.mjs:63:13
Error when loading 'D:\old-drive\Source-Codes\Bots\TicketZ-bot\src\listeners\buttonHandler.ts': 9 | LoaderErrorType2["UnknownStore"] = "UNKNOWN_STORE";
10 | return LoaderErrorType2;
11 | })(LoaderErrorType || {});
12 | var _LoaderError = class _LoaderError extends Error {
13 | constructor(type, message) {
14 | super(message);
^
error: A compatible class export was not found. [D:\old-drive\Source-Codes\Bots\TicketZ-bot\src\listeners\buttonHandler.ts]
path: "D:\old-drive\Source-Codes\Bots\TicketZ-bot\src\listeners\buttonHandler.ts"
at new _LoaderError (D:\old-drive\Source-Codes\Bots\TicketZ-bot\node_modules\@sapphire\pieces\dist\esm\lib\errors\LoaderError.mjs:14:5)
at new _MissingExportsError (D:\old-drive\Source-Codes\Bots\TicketZ-bot\node_modules\@sapphire\pieces\dist\esm\lib\errors\MissingExportsError.mjs:6:5)
at D:\old-drive\Source-Codes\Bots\TicketZ-bot\node_modules\@sapphire\pieces\dist\esm\lib\strategies\LoaderStrategy.mjs:63:13
7 replies
SIASapphire - Imagine a framework
Created by Tenjaou on 6/23/2024 in #sapphire-support
Message commands help
No description
38 replies
SIASapphire - Imagine a framework
Created by Tenjaou on 6/23/2024 in #sapphire-support
Message commands help
Alright lemme see
38 replies
SIASapphire - Imagine a framework
Created by Tenjaou on 6/23/2024 in #sapphire-support
Message commands help
No description
38 replies
SIASapphire - Imagine a framework
Created by Tenjaou on 6/23/2024 in #sapphire-support
Message commands help
this.container.logger.info(
this.container.stores
.get("listeners")
.map((listener) => listener.name)
.join(", ")
)
this.container.logger.info(
this.container.stores
.get("listeners")
.map((listener) => listener.name)
.join(", ")
)
Yes every listener is there [INFO] CoreInteractionCreate, CorePossibleAutocompleteInteraction, CoreChatInputCommandAccepted, CorePossibleChatInputCommand, CorePreChatInputCommandRun, CoreContextMenuCommandAccepted, CorePossibleContextMenuCommand, CorePreContextMenuCommandRun, CoreChatInputCommandError, CoreCommandApplicationCommandRegistryError, CoreCommandAutocompleteInteractionError, CoreContextMenuCommandError, CoreInteractionHandlerError, CoreInteractionHandlerParseError, CoreListenerError, CoreMessageCommandError, CoreMessageCommandAccepted, CoreMessageCreate, CorePrefixedMessage, CorePreMessageCommandRun, CorePreMessageParser, messageCreate
38 replies
SIASapphire - Imagine a framework
Created by Tenjaou on 6/23/2024 in #sapphire-support
Message commands help
command is loaded
38 replies
SIASapphire - Imagine a framework
Created by Tenjaou on 6/23/2024 in #sapphire-support
Message commands help
lemme try
38 replies
SIASapphire - Imagine a framework
Created by Tenjaou on 6/23/2024 in #sapphire-support
Message commands help
//ping.ts
import { Command } from "@sapphire/framework";
import { i18next } from "@sapphire/plugin-i18next";
import type { Message } from "discord.js";

export class PingCommand extends Command {
constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: "ping",
aliases: ["p"],
description: "Shows the latency of the bot.",
});
}
public registerApplicationCommands(registry: Command.Registry) {
//redacted to save writing space
}

public async messageRun(message: Message) {
const time = Date.now();
const msg = await message.reply({ content: "Pinging..." });

const roundTripTime = Date.now() - time;
const wsPing = this.container.client.ws.ping;

return msg.edit(
i18next.t("commands:ping", {
roundTime: roundTripTime,
ping: wsPing.toFixed(),
})
);
}
public async chatInputRun(interaction: Command.ChatInputCommandInteraction) {
//redacted to save writing space
}
}
//ping.ts
import { Command } from "@sapphire/framework";
import { i18next } from "@sapphire/plugin-i18next";
import type { Message } from "discord.js";

export class PingCommand extends Command {
constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
name: "ping",
aliases: ["p"],
description: "Shows the latency of the bot.",
});
}
public registerApplicationCommands(registry: Command.Registry) {
//redacted to save writing space
}

public async messageRun(message: Message) {
const time = Date.now();
const msg = await message.reply({ content: "Pinging..." });

const roundTripTime = Date.now() - time;
const wsPing = this.container.client.ws.ping;

return msg.edit(
i18next.t("commands:ping", {
roundTime: roundTripTime,
ping: wsPing.toFixed(),
})
);
}
public async chatInputRun(interaction: Command.ChatInputCommandInteraction) {
//redacted to save writing space
}
}
Yes prefix is "!"
//export.ts
import { z } from "zod";

export const config = z
.object({ TOKEN: z.string(), PREFIX: z.string() })
.parse(process.env);
//export.ts
import { z } from "zod";

export const config = z
.object({ TOKEN: z.string(), PREFIX: z.string() })
.parse(process.env);
//.env
TOKEN="{redacted}"
PREFIX="!"
//.env
TOKEN="{redacted}"
PREFIX="!"
38 replies
SIASapphire - Imagine a framework
Created by Tenjaou on 6/23/2024 in #sapphire-support
Message commands help
Anymore suggestions?
38 replies
SIASapphire - Imagine a framework
Created by Tenjaou on 6/23/2024 in #sapphire-support
Message commands help
No description
38 replies
SIASapphire - Imagine a framework
Created by Tenjaou on 6/23/2024 in #sapphire-support
Message commands help
No description
38 replies
SIASapphire - Imagine a framework
Created by Tenjaou on 6/23/2024 in #sapphire-support
Message commands help
No description
38 replies
SIASapphire - Imagine a framework
Created by Tenjaou on 6/23/2024 in #sapphire-support
Message commands help
Yes my setup is identical
38 replies
SIASapphire - Imagine a framework
Created by Tenjaou on 6/23/2024 in #sapphire-support
Message commands help
No description
38 replies
SIASapphire - Imagine a framework
Created by Tenjaou on 6/23/2024 in #sapphire-support
Message commands help
No description
38 replies
SIASapphire - Imagine a framework
Created by Tenjaou on 6/23/2024 in #sapphire-support
Message commands help
No description
38 replies