This is the code for my discord bot to show all my channel names and ids for the guild it’s in. I’m still a beginner in terms of learning JavaScript and Discord JS, can someone help me solve this issue being that in my test server the code works as shown by the screenshot but in my actual server, the
Tag: discord.js
TypeError: Cannot read property ‘delete’ of undefined
I am getting an error (Cannot read property ‘delete’ of undefined). It’s probably an easy fix but I can’t seem to figure out how to fix it. The error: My code: Answer The problem is that you try to destructure the first parameter of the callback, which is a Message object, and a Message doesn’t have a message property. If
How to make this case insensitive
I’m not sure how I can use .toLowerCase() to make my discord command case insensitive this should be simple but I’m really new to this Answer In your handler where you check for the message content in the message event Have this done Eg: if(message.content.toLowerCase() === cmdName) return;
DiscordJS filtering users from buttons and limiting buttons to user who used command
I’m trying to make a bot that lets users create embeds using a series of commands and its going well. But I encountered a problem, the bot uses buttons but to confirm something like “Are you sure this is your title?” any user can click the button; which is a problem. I only want the user who used the command
Does anyone know how to create and delete a category with channels in Discord.js?
I am trying to get my discord bot to create a category that has 3 distinct channels, each with different permissions. I would also like a way to delete this category entirely at the end of my code. Any idea on how to do it? Answer There are multiple ways to do it. Here are 3 of them: Putting parent
Reference errors appearing when importing discord bot modules
Ok so I am writing a music bot due to the more populars getting shutdown and the remaining being pretty useless. I split up the code in separate files for better readability and all that and so am using modules to import and export function & variables and when I run the program using node index.js it tells me that
My discord bot not updating status when it joins a new server
My bot not updating when someone invites my bot to their/another server. I have to restart the code, then it is working. I want that my bot updated when someone invites in status. My current code is: PREFIX = < Answer It seems you want to update the bot’s status whenever your bot joins a new server. Instead of using
Collect reaction from dm message triggered by ‘guildMemberAdd’
My bot sends a message when a new member is added to the guild. The message goes to a specific user. Now I need to collect the reaction in order to assign some role to the new member. Until this point, the code works fine. But I can’t find a way to collect the reactions, every code I’ve tried doesn’t
Not combining values in deposit command, using discord.js
I’m adding a deposit command but when I try to add the amount into the bankBalance, it doesn’t add them correctly into integers, this may sound confusing, I’ll give you an example. Example: Command: ~deposit 100, User balance: Wallet: 120, Bank: 0, Output user balance: Wallet: 20, Bank: 0100 I wish this explains it, anyways here is my code: Note:
I’m unable to push my bot’s slash commands to an array. Why?
When I try to push my bot’s slash commands to an array which I want to use to register my commands, it doesn’t seem to get pushed, as when I console.log the array, it returns an empty array. But when I log each command individually, it logs properly. Why? Here is the code I use to push my bot’s commands