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

Bot not responding to slash commands

I've just created my bot following the v14 guide. Basically everything is copy pasted from the guide except my bot's token, ID and guild ID. The bot connects fine without errors, but when typing /ping my bot doesn't come up as an option, and doesn't respond to the command. I am not sure where to start looking for the error, I tried redoing it's permissions and reinviting it, but still having the issue. The bot has admin permissions on my server. Should I share a zip of the bot (minus the token of course)?...

Error from guilds flags (?)

idk why, im still learning yk w a video JS and the how to code a bot, and i just followed every steps into that, to get an error then paste the github for finaly just got the same error

Buttons

https://srcshare.io/64bc52f9fa3442a7f7ec6724 The bot sends: this interaction failed, no errors on the console....

Weird issues with different computers

So I had an old laptop where i messed around with bots a lot and it worked perfectly fine. I decided to get into discord.js for bot creation but this was on a new desktop that i had bought. When i tried the code from the tutorial, nothing happened. I wasnt sure what was going on so i did the EXACT same thing with the old laptop i was using and it worked perfectly fine. Both have the same Node.js, Discord.js, everything is basically the same when it came to the file. The only difference was the 2...

how to create a simple /modal form command

The /modal command code structure should look something like this ```js module.exports = { name: 'ping',...

getTextInputValue not working :C

client.on("interactionCreate", async (interaction) => {
console.log(interaction.fields.getTextInputValue("request_name"))
});
client.on("interactionCreate", async (interaction) => {
console.log(interaction.fields.getTextInputValue("request_name"))
});
I also checked. This is a modal....

Delete Channel With Button

I have this simple function https://pastebin.com/LygHwdrQ which is meant to do the following: 1: You press the button 2: It deletes the ticket 3: Send a message in dms ...

channel.isTextBased() is not a function

I have a ticket bot but by trying to open a ticket it gives me the following Error: ```0|ticketer-backend | TypeError: channel.isTextBased is not a function 0|ticketer-backend | at InteractionCreateAction.handle (/home/ticketer-backend-main/ticketer-backend-main/node_modules/discord.js/src/client/actions/InteractionCreate.js:46:33) 0|ticketer-backend | at module.exports [as INTERACTION_CREATE] (/home/ticketer-backend-main/ticketer-backend-main/node_modules/discord.js/src/client/websocket/handlers/INTERACTION_CREATE.js:4:36) 0|ticketer-backend | at WebSocketManager.handlePacket (/home/ticketer-backend-main/ticketer-backend-main/node_modules/discord.js/src/client/websocket/WebSocketManager.js:352:31) 0|ticketer-backend | at WebSocketShard.onPacket (/home/ticketer-backend-main/ticketer-backend-main/node_modules/discord.js/src/client/websocket/WebSocketShard.js:481:22)...

message fetching

const joinMessage = await client.channels.cache
.get(docsSetup.ArchiveChannel)
.messages.fetch(docsOpen.JoinMessageID);
const joinMessage = await client.channels.cache
.get(docsSetup.ArchiveChannel)
.messages.fetch(docsOpen.JoinMessageID);
...

member permissions to readable format

const memberPerms = member.permissions.toArray()
console.log(memberPerms)
const memberPerms = member.permissions.toArray()
console.log(memberPerms)
``` [...

intellisense not working

when i write inv. it doesnt follow up with any suggestions, like url for example

How to create timestamps

But how Do I make this into a timestamp
.addFields({ name: "Date Created", value: `${guild.createdAt}`, inline: true})
.addFields({ name: "Date Created", value: `${guild.createdAt}`, inline: true})
This is for server info and I need it to show the date and time in a timestamp

Many typing issues with Typescript

I am new to DiscordJS, and I keep facing typing issues with Typescript.. There are some examples in the images I tried many types but none seem to work, does anyone have a solution to suggest ? Here are my dependencies : "discord.js": "^14.11.0", "dotenv": "^16.3.1"...

How to get last messages from a text channel ?

Hello, I would like to get messages from the newest to the oldest in a text channel. My way to get the oldest: ```js const oldestMessages = await <GuildText>.messages.fetch({ limit: 100 });...

I want to ping a role from config.json with discord.js

Do I have to do it like this Ex: <@&{congif.ownersRoleid}> ??...

Custom identifier for fields

is there a way to set a custom field identifier for embeds? or are you limited to just the name field?

How to make Typescript recognize type files

Hi, I am a beginner developing in Typescript. I am trying to create a bot that can use commands using client.commands = new Collection(); based on the guide. https://discordjs.guide/creating-your-bot/command-handling.html#loading-command-files ...

Unknown interaction

The idea is to use a slash command to run a separate js file, which would reduce hunger and thirst. If any of the two arrived at 15, he would send a message, through the interaction, that he needed to drink, urgently. However, when I execute the slash command, and the js file is also executed afterwards, when sending the message through the interaction, when I reach 15, it says that the interaction is unknown.

Embed: Wrong image in iconURL

Hello! I'm with Typescript. I generate my image using my GitHub repository, so I just need to push to it and use https://raw.githubusercontent.com/${GITHUB}/master/images The image has been successfully pushed (for example, see : https://raw.githubusercontent.com/lisandra-dev/velum-bot/master/images/meteo/moon/waxing-crescent.png)...