b1nzee
b1nzee
SIASapphire - Imagine a framework
Created by b1nzee on 3/12/2024 in #sapphire-support
Subcommands Not Working
how come the file name HAS to be that?
99 replies
SIASapphire - Imagine a framework
Created by b1nzee on 3/12/2024 in #sapphire-support
Subcommands Not Working
thank you, it was the precondition that was failing me 😫 thank you for the other noticed changes though too!
99 replies
SIASapphire - Imagine a framework
Created by b1nzee on 3/12/2024 in #sapphire-support
Subcommands Not Working
I have only ever used the debugger like once xD you'd probably find better results doing it, i dont really know what im doing with the debugger
99 replies
SIASapphire - Imagine a framework
Created by b1nzee on 3/12/2024 in #sapphire-support
Subcommands Not Working
The __filename stuff has been logging correctly But in the listeners I did hardcode for debugging purposes
99 replies
SIASapphire - Imagine a framework
Created by b1nzee on 3/12/2024 in #sapphire-support
Subcommands Not Working
99 replies
SIASapphire - Imagine a framework
Created by b1nzee on 3/12/2024 in #sapphire-support
Subcommands Not Working
not rn, but I can make a repo quick if you want
99 replies
SIASapphire - Imagine a framework
Created by b1nzee on 3/12/2024 in #sapphire-support
Subcommands Not Working
yeah, all of these are fresh installs, the day I made this thread
99 replies
SIASapphire - Imagine a framework
Created by b1nzee on 3/12/2024 in #sapphire-support
Subcommands Not Working
fair, thank you for informing me
99 replies
SIASapphire - Imagine a framework
Created by b1nzee on 3/12/2024 in #sapphire-support
Subcommands Not Working
has there been an update at all to the subcommands plugin that may have broke anything? shall I try a previous version?
99 replies
SIASapphire - Imagine a framework
Created by b1nzee on 3/12/2024 in #sapphire-support
Subcommands Not Working
yes index.ts
import dotenv from "dotenv";
dotenv.config();

import { DvSClient } from "./client";
import "@sapphire/plugin-api/register";
import "@sapphire/plugin-subcommands/register";

new DvSClient().login(process.env.DISCORD_APP_TOKEN!);
import dotenv from "dotenv";
dotenv.config();

import { DvSClient } from "./client";
import "@sapphire/plugin-api/register";
import "@sapphire/plugin-subcommands/register";

new DvSClient().login(process.env.DISCORD_APP_TOKEN!);
99 replies
SIASapphire - Imagine a framework
Created by b1nzee on 3/12/2024 in #sapphire-support
Subcommands Not Working
the snippets I provided just now are wrong, I forgot to use parse etc, but I have hardcoded it now
import { Listener, type UserError } from "@sapphire/framework";
import { ApplyOptions } from "@sapphire/decorators";
import { ChatInputSubcommandDeniedPayload } from "@sapphire/plugin-subcommands";
import { parse } from "path";

@ApplyOptions<Listener.Options>({
name: "chatInputSubcommandDenied",
enabled: true,
})
export class ChatInputSubcommandDeniedListener extends Listener {
public run(error: UserError, payload: ChatInputSubcommandDeniedPayload) {
console.log("ChatInputSubcommandDeniedListener", error, payload);
}
}
import { Listener, type UserError } from "@sapphire/framework";
import { ApplyOptions } from "@sapphire/decorators";
import { ChatInputSubcommandDeniedPayload } from "@sapphire/plugin-subcommands";
import { parse } from "path";

@ApplyOptions<Listener.Options>({
name: "chatInputSubcommandDenied",
enabled: true,
})
export class ChatInputSubcommandDeniedListener extends Listener {
public run(error: UserError, payload: ChatInputSubcommandDeniedPayload) {
console.log("ChatInputSubcommandDeniedListener", error, payload);
}
}
still nothing
99 replies
SIASapphire - Imagine a framework
Created by b1nzee on 3/12/2024 in #sapphire-support
Subcommands Not Working
subcommandMappingIsMissingChatInputCommandHandler.listener.ts
import { Listener } from "@sapphire/framework";
import { ApplyOptions } from "@sapphire/decorators";
import {
ChatInputSubcommandAcceptedPayload,
SubcommandMappingMethod,
} from "@sapphire/plugin-subcommands";
import { ChatInputCommandInteraction } from "discord.js";

@ApplyOptions<Listener.Options>({
name: __filename.split(".")[0],
enabled: true,
})
export class SubcommandMappingIsMissingChatInputCommandHandlerListener extends Listener {
public run(
message: ChatInputCommandInteraction,
subcommand: SubcommandMappingMethod,
payload: ChatInputSubcommandAcceptedPayload
) {
console.log(
"SubcommandMappingIsMissingChatInputCommandHandlerListener",
payload
);
}
}
import { Listener } from "@sapphire/framework";
import { ApplyOptions } from "@sapphire/decorators";
import {
ChatInputSubcommandAcceptedPayload,
SubcommandMappingMethod,
} from "@sapphire/plugin-subcommands";
import { ChatInputCommandInteraction } from "discord.js";

@ApplyOptions<Listener.Options>({
name: __filename.split(".")[0],
enabled: true,
})
export class SubcommandMappingIsMissingChatInputCommandHandlerListener extends Listener {
public run(
message: ChatInputCommandInteraction,
subcommand: SubcommandMappingMethod,
payload: ChatInputSubcommandAcceptedPayload
) {
console.log(
"SubcommandMappingIsMissingChatInputCommandHandlerListener",
payload
);
}
}
99 replies
SIASapphire - Imagine a framework
Created by b1nzee on 3/12/2024 in #sapphire-support
Subcommands Not Working
chatInputSubcommandDenied.listener.ts
import { Listener, type UserError } from "@sapphire/framework";
import { ApplyOptions } from "@sapphire/decorators";
import { ChatInputSubcommandDeniedPayload } from "@sapphire/plugin-subcommands";

@ApplyOptions<Listener.Options>({
name: __filename.split(".")[0],
enabled: true,
})
export class ChatInputSubcommandDeniedListener extends Listener {
public run(error: UserError, payload: ChatInputSubcommandDeniedPayload) {
console.log("ChatInputSubcommandDeniedListener", error, payload);
}
}
import { Listener, type UserError } from "@sapphire/framework";
import { ApplyOptions } from "@sapphire/decorators";
import { ChatInputSubcommandDeniedPayload } from "@sapphire/plugin-subcommands";

@ApplyOptions<Listener.Options>({
name: __filename.split(".")[0],
enabled: true,
})
export class ChatInputSubcommandDeniedListener extends Listener {
public run(error: UserError, payload: ChatInputSubcommandDeniedPayload) {
console.log("ChatInputSubcommandDeniedListener", error, payload);
}
}
chatInputSubcommandRun.listener.ts
import { Listener } from "@sapphire/framework";
import { ApplyOptions } from "@sapphire/decorators";
import {
ChatInputCommandSubcommandMappingMethod,
ChatInputSubcommandRunPayload,
} from "@sapphire/plugin-subcommands";
import { ChatInputCommandInteraction } from "discord.js";

@ApplyOptions<Listener.Options>({
name: __filename.split(".")[0],
enabled: true,
})
export class ChatInputSubcommandRunListener extends Listener {
public run(
interaction: ChatInputCommandInteraction,
subcommand: ChatInputCommandSubcommandMappingMethod,
payload: ChatInputSubcommandRunPayload
) {
console.log("ChatInputSubcommandRunListener", payload);
}
}
import { Listener } from "@sapphire/framework";
import { ApplyOptions } from "@sapphire/decorators";
import {
ChatInputCommandSubcommandMappingMethod,
ChatInputSubcommandRunPayload,
} from "@sapphire/plugin-subcommands";
import { ChatInputCommandInteraction } from "discord.js";

@ApplyOptions<Listener.Options>({
name: __filename.split(".")[0],
enabled: true,
})
export class ChatInputSubcommandRunListener extends Listener {
public run(
interaction: ChatInputCommandInteraction,
subcommand: ChatInputCommandSubcommandMappingMethod,
payload: ChatInputSubcommandRunPayload
) {
console.log("ChatInputSubcommandRunListener", payload);
}
}
chatInputSubcommandSuccess.listener.ts
import { Listener } from "@sapphire/framework";
import { ApplyOptions } from "@sapphire/decorators";
import {
ChatInputCommandSubcommandMappingMethod,
ChatInputSubcommandRunPayload,
} from "@sapphire/plugin-subcommands";
import { ChatInputCommandInteraction } from "discord.js";

@ApplyOptions<Listener.Options>({
name: __filename.split(".")[0],
enabled: true,
})
export class ChatInputSubcommandSuccessListener extends Listener {
public run(
interaction: ChatInputCommandInteraction,
subcommand: ChatInputCommandSubcommandMappingMethod,
payload: ChatInputSubcommandRunPayload
) {
console.log("ChatInputSubcommandSuccessListener", payload);
}
}
import { Listener } from "@sapphire/framework";
import { ApplyOptions } from "@sapphire/decorators";
import {
ChatInputCommandSubcommandMappingMethod,
ChatInputSubcommandRunPayload,
} from "@sapphire/plugin-subcommands";
import { ChatInputCommandInteraction } from "discord.js";

@ApplyOptions<Listener.Options>({
name: __filename.split(".")[0],
enabled: true,
})
export class ChatInputSubcommandSuccessListener extends Listener {
public run(
interaction: ChatInputCommandInteraction,
subcommand: ChatInputCommandSubcommandMappingMethod,
payload: ChatInputSubcommandRunPayload
) {
console.log("ChatInputSubcommandSuccessListener", payload);
}
}
chatInputSubcommandError.listener.ts
import { Listener } from "@sapphire/framework";
import { ApplyOptions } from "@sapphire/decorators";
import { ChatInputSubcommandErrorPayload } from "@sapphire/plugin-subcommands";

@ApplyOptions<Listener.Options>({
name: __filename.split(".")[0],
enabled: true,
})
export class ChatInputSubcommandErrorListener extends Listener {
public run(error: unknown, payload: ChatInputSubcommandErrorPayload) {
console.log("ChatInputSubcommandErrorListener", error, payload);
}
}
import { Listener } from "@sapphire/framework";
import { ApplyOptions } from "@sapphire/decorators";
import { ChatInputSubcommandErrorPayload } from "@sapphire/plugin-subcommands";

@ApplyOptions<Listener.Options>({
name: __filename.split(".")[0],
enabled: true,
})
export class ChatInputSubcommandErrorListener extends Listener {
public run(error: unknown, payload: ChatInputSubcommandErrorPayload) {
console.log("ChatInputSubcommandErrorListener", error, payload);
}
}
99 replies
SIASapphire - Imagine a framework
Created by b1nzee on 3/12/2024 in #sapphire-support
Subcommands Not Working
alright, think I did the listeners correctly but still not getting an output
99 replies
SIASapphire - Imagine a framework
Created by b1nzee on 3/12/2024 in #sapphire-support
Subcommands Not Working
sure, gimme a few mins
99 replies
SIASapphire - Imagine a framework
Created by b1nzee on 3/12/2024 in #sapphire-support
Subcommands Not Working
just to make sure im correct here too, this is my constructor for the SapphireClient
public constructor() {
super({
intents: [
IntentsBitField.Flags.Guilds,
IntentsBitField.Flags.GuildMessages,
IntentsBitField.Flags.GuildMembers,
IntentsBitField.Flags.GuildMessageReactions,
IntentsBitField.Flags.MessageContent,
],
partials: [Partials.Message, Partials.Reaction, Partials.User],
presence: {
status: PresenceUpdateStatus.DoNotDisturb,
},
logger: {
// instance: new DvSLogger(),
level: LogLevel.Debug,
},
allowedMentions: {
parse: ["users", "roles"],
repliedUser: true,
},
loadSubcommandErrorListeners: true,
});
}
public constructor() {
super({
intents: [
IntentsBitField.Flags.Guilds,
IntentsBitField.Flags.GuildMessages,
IntentsBitField.Flags.GuildMembers,
IntentsBitField.Flags.GuildMessageReactions,
IntentsBitField.Flags.MessageContent,
],
partials: [Partials.Message, Partials.Reaction, Partials.User],
presence: {
status: PresenceUpdateStatus.DoNotDisturb,
},
logger: {
// instance: new DvSLogger(),
level: LogLevel.Debug,
},
allowedMentions: {
parse: ["users", "roles"],
repliedUser: true,
},
loadSubcommandErrorListeners: true,
});
}
99 replies
SIASapphire - Imagine a framework
Created by b1nzee on 3/12/2024 in #sapphire-support
Subcommands Not Working
i know sapphire doesn't typically "support" subcommands in separate files, but the console.log("test") should fire at least right? and yeah i enabled that
99 replies
SIASapphire - Imagine a framework
Created by b1nzee on 3/12/2024 in #sapphire-support
Subcommands Not Working
yeah still just "Application Didnt Respond" with 0 error
99 replies
SIASapphire - Imagine a framework
Created by b1nzee on 3/12/2024 in #sapphire-support
Subcommands Not Working
i normally use bulk overwrite, must have overlooked it, but new logs:
[INFO] ApplicationCommandRegistries: Initializing...
[INFO] Test Monkey is online and ready!
[DEBUG] ApplicationCommandRegistries(BulkOverwrite) Overwriting global application commands, now at 2 commands
[DEBUG] ApplicationCommandRegistry[server] Registering id "1215064126544547890" to internal chat input map
[DEBUG] ApplicationCommandRegistry[ping] Registering id "1143509676277895168" to internal chat input map
[INFO] ApplicationCommandRegistries(BulkOverwrite) Successfully overwrote global application commands. The application now has 2 global commands
[INFO] ApplicationCommandRegistries: Took 444ms to initialize.
[INFO] ApplicationCommandRegistries: Initializing...
[INFO] Test Monkey is online and ready!
[DEBUG] ApplicationCommandRegistries(BulkOverwrite) Overwriting global application commands, now at 2 commands
[DEBUG] ApplicationCommandRegistry[server] Registering id "1215064126544547890" to internal chat input map
[DEBUG] ApplicationCommandRegistry[ping] Registering id "1143509676277895168" to internal chat input map
[INFO] ApplicationCommandRegistries(BulkOverwrite) Successfully overwrote global application commands. The application now has 2 global commands
[INFO] ApplicationCommandRegistries: Took 444ms to initialize.
99 replies
SIASapphire - Imagine a framework
Created by b1nzee on 3/12/2024 in #sapphire-support
Subcommands Not Working
oh shit, im using "Overwrite" my bad
99 replies