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

Property 'description' does not exist on type 'ApplicationCommandData'.

Hi yall, so I have this code here (https://sourceb.in/1t4I7PyZPo) but keep getting an error saying that description does not exist on ApplicationCommandData (line 5). Logging cmd gets me something along the lines of ```{ [1] dir: 'Staff', [1] data: {...

Help me with python and code this bot

Can someone help me code a bot that does things in game etx /buy if they have enough its buys what ever in the shop

Would allocating functionality to separate bots increase performance

I don't fully understand the performance of discord.js, but I have a bot that controls the project management aspect of a discord server. I want to add functionality that will measure discord message counts and content using the messageCreate event handler. On every event it will query the database and parse the content. Im afraid this will affect the performance of the bot. Should I just create a separate bot to run the message event handling.

editReply after deferReply don't works

console.log("hi1")
await interaction.editReply(`Pong! `)
console.log("hi2")
console.log("hi1")
await interaction.editReply(`Pong! `)
console.log("hi2")
...

Catch deleted messages with Events.GuildAuditLogEntryCreate

Hi, I have problem with this code. As you can see on video it logs only one random message when it wants and when rest of the messages are deleted it doesn't work. ```js bot.on(Events.GuildAuditLogEntryCreate, async auditLog => {
console.log("Delete check")...

Help me

Who error Anyone Can Fix?

How to fetch discordjs, mdn, nodejs docs and return something below

<PackageName> - <Type> <ObjName>: (if constructor) new <...>(...) ...

Error shows when i type in "node. /src/index.js

`PS C:\Users\GAL0004\Desktop\Amethyst> node ./src/index.js node:internal/modules/cjs/loader:1051 throw err; ^ ...

presenceUpdate event emitter doesn't return activity channelId

I'm using the presenceUpdate event to detect when an activity has been started. But I need to get the channel the activity has been started in (more specifically the channel Id), what can I do to get this? Because the emitter doesn't emit any details about the channel the activity is being hosted in....

How to change a user's server profile name using the bot

How do I change the server profile name for a user with a specified user ID?

Bot won't respond

Bot is in my server but wont respond to my commands whenever i type ^help in chat. Is there anything wrong with the top part of my code?...

Unknown interaction

I don't come across this error message often, typically encountering it only once every 20 times I give a command. I am curious about the cause of this error. Thinking

Dublicate shard. Many client instances for one shard.

Hello everyone, I'm using this code for a bot (https://github.com/iamnotacoder-djs/DiscordBotIda) and trying to run sharding (https://discordjs.guide/sharding/#when-to-shard). The problem is that due to the walk function in handlers/commands.js, as many client instances are created for one shard as there are commands in total. I assume that this is due to the recursive call to the walk function. If you remove
require(`./handlers/commands.js`).init(client);
require(`./handlers/commands.js`).init(client);
from index.js, then sharding works correctly, but commands do not work as logically. Maybe someone got stuck, tell me how to fix it? Thank you in advance Full code at the link to github: https://github.com/iamnotacoder-djs/DiscordBotIda This function with recursions:...

Get number of messages Member sent in the Guild

When you search in the guild for a member you will see that the "Results" represent the number of messages a user has ever sent. Is it possible to get this number via code with a discord bot?...

Counting Deleted Channels

Hello. I have a ModMail bot. I've successfully got the bot to count posted channels (tickets), but I don't know how to get the bot to count closed tickets (the channels get deleted). How do I do that? Here's my channelDelete event. Thanks....

extremeley weird issue with closing DM's between bot and user

I've been trying to solve this for the past 3 days catuncanny 1. I have a function which makes the bot question the user on DM's 2. In order to prevent having users be questioned about 2 things at once, the function checks for an open DM channel with the user before starting, and also closes the channel with channel.delete() once the questioning process is done 3. I have 2 commands that use this function...

Does djs/rest just wait until the cf ban is over?

What I exactly mean with this is that I checked the source of djs/rest and notice that I only find a wait until its unblocked again? Is this true and if yes is there a way that rest dont wait and just stop all requests until its unblocked again?...

Send welcome message in random channel when bot is invited!

```js client.on(Events.GuildCreate, g => { const channel = g.channels.cache.find(channel => channel.type === 'text' && channel.permissionsFor(g.me).has('SEND_MESSAGES')) channel.send( "Hey I'm Dank Memer" )...

`Cannot read properties of undefined (reading 'send')` when fetching guild members

Hi! I got some weird error while fetching the members list of my guild. I believe this is a lib bug, but I want to make sure I didn't miss anything on my side My code: ```js const guild = await this.getClient().guilds.fetch(guildId); const members = await guild.members.fetch();...

Slash Command Question

Is there any way to get more than one options for example in getRole?