Whenever a user joins, it failes. It worked on the last server but not now? Any help or indication that something is wrong would be much appreciated. I am new to this so sorry if bad Answer So there are a couple things wrong here. First you have 2 “clients” defined Then your code reads as follow Try this and
Tag: discord
How to create a slash command with spacing in the name?
I’ve seen some bots that have space in the name of their slash commands, ex: /admin ban But when I try to implement it, I get an error saying that the name of the slash command does not match a validation regex. My code: Error: Answer These are called subcommands. They are a good way to sort commands. For example,
TypeError: user.setNickname is not a function
so I have just finished this /setnick command for my Discord Bot, but I am getting the following error. I have tried looking for solutions on google and here on StackOverflow but I couldn’t find any regarding my problem. Does anyone know what the fix for this is? Here is the /setnick command file: Answer Should be
Problems playing audio files in Discord
So, It’s been two long days traying to figure what the reck is going on… I’m creating a Bot to my Discord Channel that plays an audio.mp3 when a command is written, like !laugh then the bot should enter the voice channel and reproduce laugh.mp3. I’ve tried in so manny different ways but the bot keeps entering the channel, the
Discord bot not fetching user data even when user id is there
I am using discord v13.6.0 . I have a 2d array in which data looks like this Here is my code . Now I am getting a error here. My code shows me curretName but it is giving me a error for the nextUserName. My error is this TypeError: Cannot read properties of undefined (reading ‘username’) at E:DiscordBotTestingLeaderBoardLeaderboardRankingsystem.js:217:42 I am
Discord.js v13 How to prevent mod commands from working on mods?
So I wanted to make a mute command for my Discord bot. It is supposed to mute a mentioned user untill they are unmuted through another command (WIP), additionaly there should be an option to give a reason. If there is no reason provided it just says Reason: none. I’ve managed to Restrict the command acces to a mod role
How to get users in voice channel without cache in DiscordJS?
I’m trying to get all users connected to a voice channel on my server. When someone talks to a bot in #general, I want to get the users inside Voice Channel 1. I’m using Node 17 and DiscordJS 13. This is my code: Also, I tried this one: But, it always returns the voice channel users that joined when I
Discord Bot Error; Uncaught DiscordAPIError: Invalid Form Body
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
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;