sapphire-support
discordjs-support
old-sapphire-support
old-discordjs-support
old-application-commands-and-interactions
Plugin-API Param question
Does the plugin-API nolonger support
transcript/:id style routes?
```typescript
import { ApplyOptions } from '@sapphire/decorators';
import { Route, type RouteOptions } from '@sapphire/plugin-api';...Solution:
Always look for a changelog file or releases page on github when updating to a new major version. Major versions always imply some breaking changes https://github.com/sapphiredev/plugins/blob/main/packages/api/CHANGELOG.md#sapphireplugin-api700---2024-11-02. Learn more about semver here: https://semver.org
PaginatedMessage to fetch data on demand
Is there an example on how to make a PaginatedMessage fetch data for a page when it is called? I dont want to get all the data from the db at once since its too slow.
Commands `status-rewards` and `status-rewards-admin` don't register on Discord
I believe everything is done correctly, have the
registerApplicationCommands method implemented. Both show up in debug logs that they are registered, yet don't show up on discord.
interactionCreate listener
```
import { Listener } from '@sapphire/framework';
export class UserEvent extends Listener {
constructor(context, options = {}) {...
Creating a decorator
I have this decorator here:
```ts
export function TemplateAutocomplete(): ClassDecorator {
return createClassDecorator((target: Command) =>
createProxy(target, {...
Question About Sapphire API
Is Sapphire plugin api can be used only for callback? for example. I want to make API for callback payment gateway that my bot will receive and confirm the payment from the user that has been successfully pay the product that i sell, and i send the the product to the DM
`Precondition` doubts.
Hi, I'm rewriting my bot from Rust's poise framework to Sapphire. In the rust version, there was a config parameter that let me run a check every time, a command is ran. These are regular commands and not slash commands aka
?avatar. Is there anything similar for Sapphire where I can provide a function that will return either true or false to know if the command should be ran or not. Secondly, how do I handle preconditions that may take sometime to execute, something sort of a database lookup which may take from 50-300ms depending on the workload for the bot. I tried doing something like below
```ts
// command file
public constructor(context: Command.LoaderContext) {
super(context, {...Solution:
Yeah, I recommend deferring it only in precondition and then use editReply or followUp in the command
best practice for hybrid commands
im wondering what the best practices for making commands that have a message and slash version would be. is it possible to have one single file (ex: ping.ts) that stores a PingSlashCommand class and a PingMessageCommand class? so far ive divided it up via 2 files. one called ping.ts and one called message.ping.ts. this is kinda annoying though...
Scheduled task pattern broken?
Hello, I started using plugin for scheduled tasks and when I do
* * * * * pattern which is for every minute, it's being multi-executed every secondSolution:
Scheduled Task payload types
Does this plugin support adding type for the payload? Tried to just add interface in tried to search docs for that but I didn't find anything about that
re-read docs and found that they actually mention ability to specify type for payload. but somehow that doesn't work for me. Tried passing just raw type, interface, actual type and still no success
the way I declare task & it's payload:...
d.ts as type for that key but that doesn't work. Solution:
Could not pass a new instance of slash command builder to registry.registerApplicationCommands
I have found out that subcommand and subcommand group type is omitted when passing a newly instance of builder. When using the callback method it's not omitted 🤔
reproduction sample: https://github.com/yuanstuffs/registry-reproduction-sample...
Command comparison
is there a way to manually compare commands versus the api? Like deep comparison how the Framework does it automatically?
i18n not giving correct strings
In src/languages/en-US/coreCommands/ping.json I have this:
```json
{
"loading": "Calculating the latencies..."
}...
Solution:
the issue was while building. Apparently esbuild converts .json to .js

refreshing all the application commands
how can i refresh every application command with sapphire? as in overwrite every single one when i launch the bot?
Global error listener
How would I make a listener that checks for any slash command error and returns a reply?
Solution:
```ts
@ApplyOptions<Listener.Options>({
name: "CoreChatInputCommandError",
event: "chatInputCommandError"
})...
run other commands inside other commands
im trying to run the "fix" command inside the "register" command but i cant figure out how to. i typed out what im attempting to basically do inside the register command but it obviously doesn't exist.

filtering custom id via name
was wondering if i could just filter via the name property instead of using the parse method
Solution:
you need to check for customId of interaction, I don't think there are the other way to do that

