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

Categories cannot have subcategories api error

Got this error:
DiscordAPIError[50035]: Invalid Form Body
parent_id[CHANNEL_PARENT_INVALID_PARENT]: Categories cannot have subcategories
DiscordAPIError[50035]: Invalid Form Body
parent_id[CHANNEL_PARENT_INVALID_PARENT]: Categories cannot have subcategories
the other day with a command that moves a channel to another category. Really confused what it means by subcategories here or how this error could come about so seeking advice. Or what could constitute an invalid channel parent? In my slash command I filter the category option with ChannelType.GuildCategory...

cant receive dm messages from the 'messageCreate' event even after enabling the channel partial

I am trying to create a modmail system but the bot doesnt seem to get any dms from the messageCreate event These are my partials and intents https://github.com/TheOreoTM/modmail-bot/blob/fc0ff782c1183c9f0363cfcc27ab83c52ac09c0d/src/lib/config.ts#L34...
No description

All GatewayIntentBits?

Is there a way to add all intents?

modmail system

When i send a message through the bot and then it creates a channel, and i reply back to the user in the created channel by the bot, it wont send the reply back. Can you help me with this please? https://sourceb.in/nFovf6nNNn https://sourceb.in/SNDixFp5mD...

Issues implementing subcommands

Hey Everyone, I am struggling and new to implementing subcommands and trying to doesn't register. https://hastebin.com/share/abitotekom.javascript The following is what I have, hope someone can help....

When to shard?

I saw something that said to shard at 2,500 guilds but I'm wondering if member count also plays a role in sharding? My bot got added to a 600k member server bringing it up to serving about 1.4 million people atm and the guild join event never fired, wondering if it's a one off occurence of something I should look into now. Thanks!...

Cant resolve zlib-sync

When using discordjs/core, I get the following error message ```console ./node_modules/@discordjs/ws/dist/index.mjs:522:36 Module not found: Can't resolve 'zlib-sync' ...
No description

Creating TypeSafe event emitter wrapper function

I have this file EventTypes.ts: ```ts import type { GuildBan, GuildMember } from 'discord.js'; import type { BanExportOptions, BanImportOptions } from './typeDefs';...

MongoDb

when i make a new db the prefixOrNo option is available when i do refresh it disapper and the project say it disappered but before refresh and restarting the project it was available and working in the project is there is a limit of options in each doc in mongo db or no?...

"Failed to find guild, or unknown type for channel" even when not using channel.add()

when starting my bot for production, since recently, this message pops up. I researched it, and it seems like the message gets triggered from the channel.add() function from discordjs
https://github.com/discordjs/discord.js/blob/7ec0bd93b0d7788e8ccf5576add37f7198be3f72/src/managers/ChannelManager.js#L33
I searched my code, but couldn't find any usage of this, and I'm wondering, where is Issue is coming from. The image also looks like, some ID was stored as a js number and got trimmed....
No description

Potential mass api usage issues

I have a moderation bot of a sort, and in my use case I have a lot of commands that might do something at a scale maybe out of normal from other bots. For example, create 50 channels at once, send a message to 500 channels at once, modify the permissions of 50 channels at once, delete 5000 messages at once. At once meaning like sequentially but in one command. I'm using sapphire so in theory I should be fine rate limit wise but is there anything I should look out for or avoid doing that discord...

Message Collector Error

I'm creating a message collector like this - however after it runs and collects m.content and sets it to username, which I can log into the console just fine - I receive the following error preventing further code run. Also getting a shit ton of type errors. OG Code ```ts...

Nickname

Hello, please, can someone help me solve this problem? thanks!! :pikaLove: (function: i want to change bot nickaname on server automaticly after turn on bot)...
No description

TypeScript ModMail

In TypeScript: How do I have a bot send a message for a user to react, remove the reaction once reacted, and then D.M. the user? I'm trying to make a modmail bot in TypeScript but have no idea how.

Error: Cannot properly serialize component type:

While refactoring and sourcing out some modals into external files, i encountered this error. Ive been trying for a few hours so im 100% sure its the exact same code. Ive also tried the modal tutorial code from the discordjs wiki and could reproduce the error when putting it in a function that returns a modal which resides in a different file....

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",...

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

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