ITOH
ITOH
SIASapphire - Imagine a framework
Created by ITOH on 11/7/2023 in #sapphire-support
messageSubcommandNoMatch listener not working
I kind of fixed it by doing this: listeners/messageCommandError.ts
import {
Events,
Listener,
MessageCommandErrorPayload,
UserError,
} from "@sapphire/framework";

export class CommandError extends Listener<typeof Events.MessageCommandError> {
constructor(context: Listener.Context, options: Listener.Options) {
super(context, {
...options,
event: Events.MessageCommandError,
});
}

run(error: unknown, context: MessageCommandErrorPayload) {
if (error instanceof UserError && this.emitter) {
this.emitter.emit(error.identifier, error, context);
}
}
}
import {
Events,
Listener,
MessageCommandErrorPayload,
UserError,
} from "@sapphire/framework";

export class CommandError extends Listener<typeof Events.MessageCommandError> {
constructor(context: Listener.Context, options: Listener.Options) {
super(context, {
...options,
event: Events.MessageCommandError,
});
}

run(error: unknown, context: MessageCommandErrorPayload) {
if (error instanceof UserError && this.emitter) {
this.emitter.emit(error.identifier, error, context);
}
}
}
Now my messageSubcommandNoMatch listener works. So is this the intended way of tackling that, or am I doing something else wrong fastthink
5 replies
SIASapphire - Imagine a framework
Created by ITOH on 11/6/2023 in #sapphire-support
Register a command on every guild
Yea, but I still want a considerable UX with the commands, especially their names. Also a single command can not have more than 4000 characters (name, description, options...). Which is also kind of a bummer sadge
19 replies
SIASapphire - Imagine a framework
Created by ITOH on 11/6/2023 in #sapphire-support
Register a command on every guild
CheeseThinkFrog okay, well thank you! I will look into more options and maybe I can find a better solution 02laugh
19 replies
SIASapphire - Imagine a framework
Created by ITOH on 11/6/2023 in #sapphire-support
Register a command on every guild
I just have so many commands, that 100 global commands are not enough CatBlush
19 replies
SIASapphire - Imagine a framework
Created by ITOH on 11/6/2023 in #sapphire-support
Register a command on every guild
Or should I add the guild id to guildIdsToFetch and then sapphire does the rest?
19 replies
SIASapphire - Imagine a framework
Created by ITOH on 11/6/2023 in #sapphire-support
Register a command on every guild
How would I create the command in a guild using that though ThinkFrog
19 replies
SIASapphire - Imagine a framework
Created by ITOH on 11/6/2023 in #sapphire-support
Register a command on every guild
Thanks, but the problem with that one is, that I do not have every guild id I need. What I mean is, when the bot is added to a new guild, I need it to create all commands there too.
19 replies