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

interaction.showModal not working

interaction.showModal doesnt work, I dont know why. Code: `` this.container.logger.debug("Start Editing...") const modal = new ModalBuilder().setTitle("Nachricht bearbeiten").setCustomId(modaledit${swallowed.id}`)...

Type T[P] does not satisfy constraint Option<any>

When building my project on my ubuntu server, with tsc, I get those errors, its more a TS issue than djs but I'm clueless, cause it works on my local windows machine.
No description

Undefined ?

Why i get undefined ``js client.on('ready', () => { console.log(Logged in as ${client.user.tag}!`);...
Solution:
Now i see that random console.log

How can i add all itents

const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildMessages] });
const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildMessages] });
...
Solution:
Found the response :
const { Client, IntentsBitField } = require('discord.js');
const client = new Client({ intents: new IntentsBitField().add(3276799)});
const { Client, IntentsBitField } = require('discord.js');
const client = new Client({ intents: new IntentsBitField().add(3276799)});
...

UserSelectMenu

Is there a limit to how many users you can select via UserSelectMenu's? (Discord Limits)

NodeJS version too low for DiscordJS

I keep getting this error when I try start the bot on my Ubuntu server but everything works fine locally, is there something I missed with the new update?
No description

SyntaxError: The requested module '@discordjs/util' does not provide an export named 'calculateShard

I am unsure where to go for help, so I'm putting it here. I have no idea where this error is coming from. I looked into ws and rest, and I can't find anything that points me to right direction ```ts import { Client, GatewayDispatchEvents, GatewayIntentBits, InteractionType, MessageFlags } from '@discordjs/core'; import { REST } from '@discordjs/rest';...
Solution:
"resolutions": {
"@discordjs/util": "0.1.1-dev.1675598630-405f940.0"
},
"resolutions": {
"@discordjs/util": "0.1.1-dev.1675598630-405f940.0"
},
...

Should my bot sending out dm's trigger it's own messageCreate event?

All of a sudden my bot is registering it's own messages as events

How can I update a message only via its messageid and channelid?

I researched and found this solution that looks reasonable but sapphire container client does not like it
const message = await container.client.cache.get('xxxx').messages.fetch('yyyy');
const message = await container.client.cache.get('xxxx').messages.fetch('yyyy');
...

Giveaway ends in "active time changes"

Hello, this is my function to show, when giveaways is ends, but its doesnt works, how i can make this? (first actually
No description

Get content as resolved tags

Couldn't figure out how to title it, but I'd like to take a message like hey @<213123123> look in channel <#1037547185492996208> and get that as it's resolved version so like hey joe look in channel #updog - Is there a DiscordJS function to do that? Thanks!...
Solution:
There's a .cleanContent variable pog

Follow announcement channel

How do I follow an announcement channel? Like ```js let announcements = client.channels.fetch("id")...
Solution:
Yep it is but in v13 its a bit different, better if you ask me KEKW

Variable slash command argument parsing

Is it possible to have slash commands with a variable amount of arguments, up to perhaps 20? If not I think I will parse a string but wanted to check if there's a batter way to do this.
Solution:
I see, yeah that would work but I want it to be possible for text that is not a mention to resolve too. I've decided to write my own resolvers to that end, but thanks for the help!

Ratelimits?

How often can a bot update channel permissions using the overwrite function?

receiving invalid message id

Either I'm getting something wrong or something aint right but in the image below you see the bot replying to a command and using the ID to fetch the message again, why? Because I wanted to verify its the correct ID before moving onward but then I get the error
{ message: 'Unknown Message', code: 10008 }
{ message: 'Unknown Message', code: 10008 }
So now I'm obviously confused and don't understand what I screwed up...
No description

Webhook posting in incorrect guild

My bot is creating it's webhook and posting in my development server instead of production. I've reviewed the environment variables and they match intended values. I've debugged the values and they show correctly except for the webhook information. I'm using Sapphire v4 and DJS 14.7.1. Any help would be greatly appreciated! console output...

What is the Best approach to developing a bot and reloading the new changes into it?

I heard that logging in too many times can lead to rate limits. is there a good solution for this issue? I want to change something, build it run it and test it on discord....

BaseMessageOptions#components does not take Builders

Hey everyone, so I've just downloaded djs 14.7.0 and i'm migrating my bot. I used to have a few .send({ components: [myComp] }), where myComp was the equivalent of what is now a Builder. So now i've updated it to a builder, but it is no longer accepted by TypeScript. A few examples: ```ts src/commands/General/code.ts:169:86 - error TS2322: Type 'ActionRowBuilder<AnyComponentBuilder>' is not assignable to type 'APIActionRowComponent<APIMessageActionRowComponent> | JSONEncodable<APIActionRowComponent<APIMessageActionRowComponent>> | ActionRowData<...>'....
Solution:
Found it, my action rows need to have a generic set, i cannot use the broad ActionRowBuilder.

fetch channel returns undefined

Hello. I have this code, which worked before I believe: ```js let theChannel = await client.channels.fetch("1062775764853985321")...

Node.js bot start issues.

When I try running my node index1.js (yes there is a 1), I just get a reply with big green letters saying “MODULE_NOT_FOUND”.