sapphire-support
discordjs-support
old-sapphire-support
old-discordjs-support
old-application-commands-and-interactions
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”.
yO mY bOt HaS gLoBaL cOmMaNdS bUt I dOnT hAvE sUpPoRtS cOmMaNdS bAdGe
yO mY bOt HaS gLoBaL cOmMaNdS bUt I dOnT hAvE sUpPoRtS cOmMaNdS bAdGe
Error Dashboard
Hello,
I have an error in my dashboard.
Could you help me because I don't understand what's going on
...
My Welcome Message And Auto Role Doesn't Work
```js
const Discord = require('discord.js')
const client = new Discord.Client()
client.on('guildMemberAdd', (member) => {...
Solution:
I can tell you that you're using
.cache.get
which means that you're probably just not finding the channel or guild because it was never added to the cache. You should fetch the items you needIterating over all server members OR iterating over people with x role
Hello. Thank you for always being so helpful and taking care of us.
I'm having trouble iterating over but users and boosters. So my first approach was fetching all guild members, and iterating over that and checking if they are boosters, but fetching members times out.
So I tried this simple fetch of all the role members:...
Solution:
If fetching members times out it means you didn't give your bot the guild members intent
how would I rerun a command thru a button
I wanna re-run a command using a "Continue" button ```ts
public async run(interaction: ButtonInteraction) {
if (interaction.inCachedGuild()) {
const voiceChannel = interaction.member.voice
if (voiceChannel.channelId) {...
Varying parsing options?
With slash commands, is it possible to have a varying input option depending on a condition?
Say there are two input options:
The first one may ask for a channel or a role
The second one would then take a channel or a role depending on what the user picked on the first argument...
Solution:
It ain't possible
Do Partials Create Un-Typesafe Code?
If I am listening for say a message update event with partials of messages and I receive a partial message in that event with only the ID and no other information, is it possible for me to access a value that doesn’t exist on the object sent to the event listener?
My assumption would be there’s a Message type and a PartialMessage type and the onMessageUpdate() event listener would give a PartialMessage | Message and you’d use the .partial property to determine the state of it
From the docs though it only sends a message object which could be partially constructed, resulting in accessing a property that’s null - creating a runtime error that could have been caught with types?...
My bot wont respond to my commands
Heres my code:
const express = require("express");
const app = express();
...
Fetch membercount?
const theGuild = await botclient.guilds.fetch(channels[i].server, { force: false, allowUnknownGuild: true }).catch(() => null)
console.log(theGuild.memberCount)
const theGuild = await botclient.guilds.fetch(channels[i].server, { force: false, allowUnknownGuild: true }).catch(() => null)
console.log(theGuild.memberCount)
Solution:
Oh. Its needed to be forced for whatever reason
Getting info from JSON
```js
const counterName = interaction.guild.channels.cache
.filter(channel => channel.name.startsWith("ticket"))
.map(channel => parseInt(channel.name.split("")[1]))
.sort();...
Really need help that no body is willing too
I was wondering if someone could help me with making a modal. I have made the Modal, but i need help with the event of ModalSubmit thing. I need it to do the profile system. And like turing the Modal into the embed after the Modal has been submitted. Can someone help me with that?
Help
hey, just need help with something. When I invoke the command, it reacts on the embed. (I forgot the code to do that feature lol)
Welcome
Hi, welcome to the #discordjs-support forum channel. Forum channels work similarly to thread-only channels, but come with a handy post search, so if you are seeking support with something, you can probably find an answer without creating a new post.
This forum has labels to divide posts into which version of discord.js is being used. Please try to tag your posts appropriately.
When creating a post, you will have to assign a label before posting, if one is missing, please assign "🧵 Miscellaneous" and contact @Developers to add the missing label....