Sapphire - Imagine a Framework

SIA

Sapphire - Imagine a Framework

Welcome to the Ruby Discord server! Finally split off from the Sapphire bot.

Join

sapphire-support

discordjs-support

old-sapphire-support

old-discordjs-support

old-application-commands-and-interactions

Api not running

hey!, I am trying to create a api. What i have so far: ```ts const client = new SapphireClient({ defaultPrefix: '!',...

Multiple manual tasks

Hello, I am trying to create multiple manual tasks, however the task does not execute. I don't know if I am doing anything wrong, but it just does not run like it should. The terminal says the task is created successfully but never runs after the delay.
No description

Error using User Apps in my bot

I get this error while using a user application cmds ```ts 2025-04-21 14:37:53 - ERROR - Encountered error on event listener "CorePreChatInputCommandRun" for event "preChatInputCommandRun" at path "::virtual::" DiscordAPIError[50001]: Missing Access 2025-04-21 14:37:53 - ERROR - at handleErrors (C:\Users\Tejas\Desktop\Source-Codes\Bots\rudescore\rudescore-rewrite\node_modules.pnpm@[email protected]\node_modules@discordjs\rest\src\lib\handlers\Shared.ts:148:10)...

returning different things to a run method

I was wondering if it is possible to return for example, a string to a chatinputrun method and have sapphire know to just reply to the interaction with that string or for example return an object with an embeds property with valid embed json same deal

client permissions failing to resolve in channel

I just upgraded from: DiscordJS 14.8.0 > 14.18.0 Sapphire 4.2.2 > 5.3.3 ...

Some Listeners/All Interaction Handlers not working

Some listeners work some dont. For example, ready listener works and some events work (REST debig and music), but this (screenshot) event doesnt work or some others as well. None of the interaction handlers work (screenshot added in a new message)
Solution:
im gonna add "name" property to every handler and every listener
No description

Running into issues with registerApplicationCommands

So I am running into an issue with registerApplicationCommands, for some reason it happens only when the SlashCommandBuilder has Subcommands or Group of subcommands. I console logged the data of the SlashCommandBuilder but still same problem. Edit: I extended the Subcommand class to my own liking and added automatic Builder creating upon creating the class within commands. I'll add the screenshot at the bottom cuz i forgot to show it...
No description

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.
No description

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

DetailedDescriptionObject

Hello, I'm almost 100% sure that this is a bug

`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 second
Solution:
Our plugin doesn't control this, the underlying https://docs.bullmq.io/ does

Scheduled Task payload types

Does this plugin support adding type for the payload? Tried to just add interface in d.ts as type for that key but that doesn't work. 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:...
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...
Next