discord.js - Imagine a 👻

DIA

discord.js - Imagine a 👻

Support server for discord.js, a Node.js module to interact with Discord's apps API.

Join

djs-questions

djs-voice

BitFieldInvalid

```js const { Client, GatewayIntentBits, MessageEmbed } = require('discord.js'); const client = new Client({ intents: [ GatewayIntentBits.Guilds,...

Type error: cannot read properties of undefined

```js const { Client, Intents, MessageEmbed } = require('discord.js'); const { REST } = require('@discordjs/rest'); const { Routes } = require('discord-api-types/v9'); const { SlashCommandBuilder } = require('@discordjs/builders');...

I can't use permissionOverwrites methods

Maybe i'm missing some required things.

Custom 4 stats

hello, good evening everyone, I was programming my discord bot, and I wanted to know how custom 4 works, which is from {emoji} {state} , I appreciate your attention...

What is the correct way to allow my bot to join a voice channel?

im getting this error: TS error: TypeError: message.member.voice.channel.join is not a function at Client.<anonymous> (C:\Users\pbnjr\OneDrive\Documents\Development\Discord Bots\bot.js:76:67) {stack: 'TypeError: message.member.voice.channel.join …uments\Development\Discord Bots\bot.js:76:67)', message: 'message.member.voice.channel.join is not a function'}, would anyone be able to tell me the correct way to write this?...

my bot doesnt respond when i input my command?

Here is my code, my bot doesnt seem to respond when i put "!hello" in chat, what can i do to fix this?

kick cmd err?

I finished the code of the kick command and in fact everything went well, I tried to execute the command again but now the bot gave me the error that "The application did not respond", I did not understand why since the code is fine for me, I wanted to ask, this is because this error comes out quite a lot, but there are few times where the command works for me and others when it doesn't. I'll leave the kick code belowww. ...

I'm confused

So i am unsure if this is the right discord or place to ask but I'm new to making a discord bot. I have an embed but when i try to add an image it doesn't load, is there something I'm missing? I tried using an image from a tutorial and it worked but when I added mine in it wouldn't load at all

Create a player loop for a blackjack game

Hi everyone! I'm currently implementing a game of blackjack in my bot, using an embed and buttons for the game information and functions. It is two-player, with the command to start the game having an option to mention the other player, with player 1 being the command initiator. My issue is in how to make the game loop back and forth between both players then break when someone wins. The code specifically for the game itself is below:...

SlashCommand Naming

Hello, I’m trying to add a sub command named "allowAdminBypass" im getting thrown an error saying it doesn’t pass the regex validator. I checked the regex on the discord’s official docs and found that the naming should be working. Tell me if I’m missing something, if not I’ll gladly open a PR

newPresence returns undefined inside presenceUpdate event

code ```client.on('presenceUpdate', async (oldPresence, newPresence) => {
if (newPresence.member.presence.status.includes("something")) { .. ...

UserInfo js v12

Hello, I would like to make a userinfo command, so I program it in js v12, does anyone know how I set the server entry date and account creation in v12?

I get an error about the interaction

Im trying to make my first discord bot. Currently ive got this `// commands/ping.js module.exports = { data: {...

Is it possible to add "streaming" text feature to text via Discord.js? Would that be allowed?

ChatGPT (and other models) have these feature called "Streaming", where it shows the text its generating as if its being typed in real time I want to implement this to my Discord bot because I think it looks cool. I am thinking of doing it by constantly editing the message to make it look streaming. But I'm worried about the rate limits and how it might cause me to get into issues. Would simply staying below the rate limit (50req/s, afaik) be enough to allow me to actually implement this feature? The "constant edits" speed I'm thinking about currently is about 2 edits or 5 edits per second. But I'm worried this may be "spammy behavior"....

How to find a specific word in a sentence

As the title says I am trying to find a specific word in a sentence e.g the fox was walking. I want to pull the word fox and give it a variable name to be used else where.

How to make it auto stop

```js const { Client, GatewayIntentBits } = require('discord.js'); const client = new Client({ intents: [...

help

let guildArray = await process.oauth.getUserGuilds(data.access_token); It returns me with the error: 401 Unauthorized on GET /api/v9/users/@me/guilds any ideas? thanks for the help...

Creation of a selection menu

Good morning. To accompany my embed, I want to add a selection menu that retrieves the values ​​stored in my database and reuses them to make the label of my options. Here is the code and the error

Some issue with the code that doesn't allow the creation of slash command error code 400

discord.js slash command ```js const { Client, GatewayIntentBits } = require('discord.js'); const client = new Client({...

`fetchStarterMessage()` doesnt give me the first message of the thread

I am trying to get the first message associated with the thread. But the message object returned from the fetchStarterMessage is not giving me that. Below is the code I used to capture the thread creation. ```module.exports = { name: Events.ThreadCreate, async execute(thread, newlyCreated) {...