Sapphire - Imagine a framework

SIA

Sapphire - Imagine a framework

Welcome to the Sapphire Discord server! The next-gen object-oriented Discord.js bot framework can be found here.

Join

sapphire-support

discordjs-support

old-sapphire-support

old-discordjs-support

old-application-commands-and-interactions

Autocomplete TextInput

Is it possible to suggest something for the text input? https://discord.js.org/docs/packages/discord.js/14.15.2/TextInputBuilder:Class...
Solution:
There is autocomplete for command options but that's it. It doesn't exist for text input components.

BulkOverwrite has stopped functioning

In the last 5 months have there been any breaking changes to how commands register? I created 2 sapphirecli slash commands and one has appeared after several days (roll), the other one (createchannel) was pushed 2 hours ago and has not shown up in the BulkOverwritten guild yet.
Solution:
I think I might be deleting/creating my container incorrectly, is this not enough to update a running container?
No description

Custom logging messages

How can i create custom logs? I want to change the colors and text used in logs along with icons, where and how could i make that change?...

logging registered commands

how can I, at runtime, send all bot commands to the console for example?
Solution:
you could use colorette yourself but you cant edit the [INFO] [DEBUG] etc of the plugin logger

Registering Commands Issue

Hey there, I've recently started using sapphire, and I've used it before without running into this issue, but when I run my project (using bun, I've tried npm as well, same issue.) I continuously get the error
error: A compatible class export was not found. [C:\Users\iratm\OneDrive\Desktop\Unnamed\src\commands\util\test.ts]
error: A compatible class export was not found. [C:\Users\iratm\OneDrive\Desktop\Unnamed\src\commands\util\test.ts]
and I'm not sure what the issue is because I've followed the docs exactly besides changing the name of the class...

Scheduled Tasks not working

Hi, I've been trying to add the scheduled-tasks plugin but it doesn't seem to work, i honestly don't know what I'm doing wrong. ```ts import { ScheduledTask } from '@sapphire/plugin-scheduled-tasks'; ...
Solution:
also you're missing /register here

Help with slash commands

Hello, I'm trying to work on a project that involves doing some type of user lookup in a database. My current code looks like this: ```typescript public override registerApplicationCommands(registry: Command.Registry) { registry.registerChatInputCommand((builder) =>...
Solution:
instead of adding a string option, add a user option. You can see this in action with many of @Spinel 's commands for the target option

API References

Is there a webpage containing all API References for the framework. For example InteractionHandler, all its functions, their purpose, return values, what arguments they take in etc... So a detailed technical page. I can see sapphire/shapeshift and some other stuff have it, but not framework. Which is the main one.

Custom logger transport

Hello is they a way to set custom logger transport (like what winston allow to do) with sapphire logger (plugin logger) ? I saw other ppls also want similar things/support with winston...

How do i enable DM message detection?

I have 'messageCreate' listener on bot, but it does not seem to detect the messages received by the bot in dm.
Solution:
Assuming you followed the instructions from the second big red block on the guide: https://sapphirejs.dev/docs/Guide/getting-started/getting-started-with-sapphire You have to also enable the Channels partial https://discordjs.guide/popular-topics/partials.html#handling-partial-data...

Multiple Command Folders?

I want to make 2 different bots on 2 separate project folders in the same hard drive. My second bot keeps getting errors from Sapphire reading the command folder on my first bot. I don't use any fixed path; I only use relative paths. How do I make Sapphire look into the correct command folder?
Solution:
So I switched the "REQUIRES OAUTH2 CODE GRANT" off and it works now! :yay:

node-gyp build problems with @sapphire/type

Trying to install @sapphire/type, bufferutil or other native libraries fails on my windows machine. Visual studio throws syntax errors parsing the node includes. The problem does not occur with clang on my linux machine. As vs22 is the recommend version for node-gyp 10.1.0, I'm puzzled what the error might be, however I have no direct experience with node modules in this sense....

Error importing a plugin

here is my index.js - https://pastebin.com/3HDUAfVY Here is the plugin I'm trying to import and having an issue with - https://pastebin.com/45Nm9hSf I am not great with javascript, maybe I'm missing something? can someone point me in the right places?...
Solution:
you placed it inside of "src/commands", which the command store expects everything inside of there to extend the "Command" class, causing that error to occur as for how plugins are done: you can refer to here https://github.com/sapphiredev/plugins/tree/main/packages im unsure if there's a guide on making them or not...

Question to Plugin i18next

I would like to start using @sapphire/plugin-i18next. Can i fetch language files from a another repository (or from my own npm module)?...
Solution:
Both yes if you set the path accordingly.

Slash Command Decorator

is it possible to use @sapphire/decorators, to make slash commands?
Solution:
the library exports no decorators for it so you'll have to write your own, it is possible to use decorators in general to register slash commands though.

Serverless

Is possible running on a serverless platform like Vercel, AWS Lambda, etc..??

eslint autofix problems

Hello, i started using@sapphire/eslint-config for my project. Now i would like to solve these problems. The most erros is because explicit member accessibility. ...
Solution:
no, eslint rules are autofixable only if they provide auto fix functions. These rules simply do not. That's also nothing to do with the config, the config just enables/disables rules. Those rules are provided by the @typescript-eslint/eslint-plugin package (the official eslint plugin for linting typescript files). Notably you can see which rules have auto fixers here for the eslint base and here for @typescript-eslint...
No description

Error [UNLOADED_PIECE]: The piece 'ready' does not exist.

Hello ! On this code : ```js import { Listener } from "@sapphire/framework";...
Solution:
you can set a name for the events, so you can name them differently but you can set the "event" property the event you need still that way you can have multiple listeners for a single event...

Error please help

```ts import { ApplyOptions } from '@sapphire/decorators'; import { Command, RegisterBehavior } from '@sapphire/framework'; import { send } from '@sapphire/plugin-editable-commands'; import { Subcommand } from '@sapphire/plugin-subcommands';...