Sapphire - Imagine a Framework

SIA

Sapphire - Imagine a Framework

Sapphire is a next-gen object-oriented Discord.js bot framework.

Join

sapphire-support

discordjs-support

old-sapphire-support

old-discordjs-support

old-application-commands-and-interactions

error

anyone know why im getting this
No description

Paginated Message Replies Only to Interactions?

When I use a paginated message from @sapphire/discord.js-utilities with an interaction and call the run method it replies to the original interaction. However when I follow the same process with a message object it does not reply to the original message. I was wondering if this is perhaps an intents issue or the like but having given the bot all intents and scoured the docs I still can't find a solution. Any help would be much appreciated.

Easy way to add per command permissions/restrictions

Is there an easy way to add a restriction for any command so that it can only be ran by a member with a specific role or in a specific channel. i know you have to integrate it into your database but what the easiest way to set this up. ive been trying to set this up with a precondition for all commands where it checks the command name and checks the database to see if there are any restrictions in place

changing directories

Hey, I'd like to change the directories where routes and interaction handlers are stored, as the default names don't suit my codebase. I've tried changing them in .sapphirerc.json but with no success. Anything else I could try or there is no way of changing them?

editable commands

Is there anyway i can make it so that when someone edits the command it edits the original response and not send a new message everytime?

Message Context Menu Command Not Registering

I am attempting to create a command that shows up when selecting a message. The command code (in src/commands) is: ```ts import { Command } from '@sapphire/framework';...

Remove application commands

How can I remove application commands? I don't see them in the chat with / but I still see them in integrations.

How to declare the BulkOverwrite property in JavaScript?

I've been having trouble trying to find out how to declare the BulkOverwrite option for Sapphire, searched around but couldn't find anything for my use case.

Shapeshift: Type instantiation is excessively deep and possibly infinite

```ts s.object({ filteredWords: s.string .lengthLessThanOrEqual(32) .array.lengthLessThanOrEqual(50),...
No description

Can't run sapphire using bun

using templates from official repo

Augmenting Container Failed

```ts declare module '@sapphire/pieces' { interface Container { db: PrismaClient;...
Solution:
Run yarn dedupe

TypeError: Cannot read properties of undefined (reading 'channels')

I am trying to automate the welcome messages through the use of a bot and have a functioning listener for the guildMemberAdd event but when trying to get the id of the channel I want to send the message to I get this error. My code is the following ``` import { Listener } from "@sapphire/framework"; import { Client, TextChannel } from "discord.js"; ...

GuildMemberAdd Event LIstener

I am trying to create an event listener using sapphire ts and discord js. I am trying to find a way to test the event without having to create and ban accounts repeatedly. I tried using the node.js event emitter like so
const emitter = new EventEmitter();
emitter.emit("GUILD_MEMBER_ADD, GuildMember)
const emitter = new EventEmitter();
emitter.emit("GUILD_MEMBER_ADD, GuildMember)
...
Solution:
Worked in my eval command. Make sure it's actually the Client instance you're trying to use emit() on. Inside a command file if you're extending the Command class, it would be ```ts this.container.client.emit()...

arguments

how to make arguments throw error when smh is not filled for ex !prefix set - but the prefix is required...
Solution:
found it, i was using wrong event. correct event: subcommand error

quick question

is there a way to use sapphire with command cstegories such as src/commands/misc/... (just folders to create)
Solution:
Other than that you were also given an answer by Kyra in #off-topic - yes

Logger

I am trying to use the logger in shard file, I registered the logger in the /lib/setup file
Solution:
There isn't then

Sharding

Hey! so I was looking at the previous posts about sharding, as it says sharding is completely on D.JS, then what does the shards: auto does in the SapphireClient?
Solution:
That's part of ClientOptions in discord.js, not sapphire related. https://old.discordjs.dev/#/docs/discord.js/main/typedef/ClientOptions?scrollTo=shardCount If set to "auto", it will spawn the recommended amount of shards from discord.js...

Modal listeners

Hello, I have listeners for contextMenu and for chatInput but which one is for a modal of what do I need to do to get one for modals? I would like to use a listener for modal error handling.

Can't use Sapphire CLI

I installed sapphire globally using yarn but for some reason it's not working
Solution:
add your yarn global bin to your PATH

pollSync error

I just started the bot and I get this error by default ``` C:\Users\Charl\OneDrive\Escritorio\Rox\node_modules@sapphire\utilities\dist\lib\pollSync.js:10 AbortSignal.abort().reason.constructor...