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 Server
Aanie5/25/2023

edit embed

hello, this is my command for edit embed, but i must somehow implement edit embed by message id, how i can do it? what i must add? ```js const { Client, Intents, MessageAttachment, MessageEmbed } = require('discord.js'); module.exports = { name: "edit-embed",...
Bbomi5/22/2023

broadcastEval blocks all shards

Hello. I have a broadcastEval which calls a function on each shard. After running on about half of the shards, all shards "freeze" (They don't respond to any interactions or messages). After about 20-30 seconds, all shards resume normal operation. Then the shards that hadn't completed their function completes it, and the shards respond to all the interactions and messages that they got during the "freeze". This happened suddenly and to code that has been working well for many months....
IItaChi5/20/2023

TypeError: import_undici4.FormData is not a constructor

I get this error : TypeError: import_undici4.FormData is not a constructor when i try to send an attachment Code : ```js...
IItaChi5/19/2023

client.ws.ping = -1 ??

client.ws.ping returns -1 why ?
No description
LWLiving Water5/19/2023

typescript error

why am i getting these errors **error TS2503: Cannot find namespace 'ChatInputCommand'. 9 public override registerApplicationCommands(registry: ChatInputCommand.Registry) {...
LWLiving Water5/12/2023

typescript: slash command

how do i create a slash command in typescript inside the index file
RRavelt5/10/2023

What is cached?

I can't seem to find a solid answer for this, what is always cached by discord js on startup and what needs to be fetched? Right now my understanding is guilds and channels are always cached, while members should be fetched always. Not sure about roles
MMRDGH28215/5/2023

Disabling button received from Button Interaction Handler

Is it possible to disable button interaction received via interaction handler? Something like - interaction.buttonComponent.disable() Or do I have to recreate the same button & use interaction.update()?...
MMRDGH28215/4/2023

Does not send embed in thread, does not throw error, does not log anything

https://github.com/MRDGH2821/Perpetual-Mechanical-Array-Bot/blob/rewrite-sapphire/src/damageLeaderboard/listeners/LBPostRegister.ts#L77 My bot is able to execute the run method in this listener, but somehow it doesn't run sendLogs method defined in the listener class....
Aanie4/23/2023

Embed Edit command.

Hello, there! I have one problem, i want /embed-edit "messageid" "atributes" command, but i dont know, how to make it. Please, any solution, how to make simply and fast? :/ Thanks...
MMRDGH28214/10/2023

Handling modal submissions

What Is the correct way to handle modals? https://github.com/MRDGH2821/Perpetual-Mechanical-Array-Bot/blob/rewrite-sapphire/src/baseBot/commands/confess.ts#L207 I tried this way, but the logs throw Unknown Interaction error. So I definitely know this is incorrect way to do. ...
Eeuvoid.4/9/2023

Cannot find module './_baseGet'

```js node:internal/modules/cjs/loader:942 throw err; ^ ...
RRuin 🐲4/4/2023

Having trouble with components

I'm trying to update Discord.js from 13 to 14, but I'm having trouble with components. TS is complaining about a missing type field in row, but adding it does nothing. What am I doing wrong? ```ts const row = new ActionRowBuilder({ components: [ new ButtonBuilder({...
NPNaryani Priya3/29/2023

Nested message component collectors

How should I be handling nested message component collectors? What the best way to do it...
MMRDGH28213/26/2023

APIInteractionDataResolvedGuildMember does not have id

While fetching for member using interaction.options.getMember('member') it gives two types - GuildMember|APIInteractionDataResolvedGuildMember out of which the second one literally doesn't have member's snowflake ID I saw this https://discord-api-types.dev/api/discord-api-types-v10/interface/APIInteractionDataResolvedGuildMember and confirmed that it really doesn't have id field How am I supposed to fetch such a member (basically type guard the member)?...
No description
SSwiizyy3/19/2023

Error server

How can I solve this error ? ``` Error [ERR_SERVER_ALREADY_LISTEN]: Listen method has been called more than once without closing. at __node_internal_captureLargerStackTrace (node:internal/errors:477:5)...
Cchillihero3/17/2023

How big is the difference between xyz.cache.get() and await xzy.fetch()?

fetch returns the cached thing aswell if it exists, so except the Promise difference i see not really a problem with using await fetch all the time. Is this consider bad practise? & How big is the difference time & performancewise?
RRhys3/15/2023

Throwing on unhandled interaction

Hey, I just wanted to quickly check this idea - If I assign a listener to interaction create and then set a 4 second timeout, if the interaction hasn't been deferred or replied to I can log an error right?
C-Carlos👑3/4/2023

Command info command issue

I have a command info command, but when I try to get information on a command called "flags" it returns this error: ```js at ArrayValidator.handle (C:\Users\cmart\Desktop\Sapphire\node_modules@sapphire\shapeshift\dist\index.js:457:70) at ArrayValidator.parse (C:\Users\cmart\Desktop\Sapphire\node_modules@sapphire\shapeshift\dist\index.js:201:88)...