Questions tagged [discord.js]
discord.js is a Node.js module that allows the developer to interact with the Discord API. Use this tag for questions about the usage of discord.js, not for questions regarding the Discord API or Discord in general (for API questions, use the 'discord' tag). Consider also using the 'javascript' and the 'node.js' tags.
discord.js
17,295
questions
0
votes
0
answers
5
views
VS Code autocomplete for discord.js module exports
I code discord bot in VS Code. I liked it but sometimes its too hard becasuse autocomplete doesn't work. I have main file and then folder with all commands.
In main file i have something like this:
...
-2
votes
0
answers
24
views
NodeJS/discord.js issue: TypeError: Cannot read properties of undefined (reading 'id')
I am working on a bot and am building an Audit Logging system based on a tutorial from The North Solution on YouTube. I keep getting this error when an audit log event is generated. I've spent hours ...
-1
votes
0
answers
13
views
Discord gacha bot "error" (gacha not showing the card)
This is the gacha function i used:
if (command === '!gacha') {
const now = Date.now();
if (cooldowns.has(userId) && now - cooldowns.get(userId) < 5 * 60 * 1000) {
await ...
0
votes
1
answer
21
views
Is there a way to manipulate the order of execution of arguments in a Discord.py async function?
First off, I apologize if I am using wrong terminologies on this question. Hopefully, I can come through with the details.
I am trying to send files(local images) and embed using the command await ...
0
votes
0
answers
27
views
When a button is clicked, it creates a channel (ticket bot)
when i run my code:
if(!interaction.isButton() || interaction.customId !== 'ticketCreate') return;
guild.channels.create({
name: "test",
type: ChannelType....
0
votes
0
answers
21
views
I am making a discord bot but it won't start up when I run the 'startup.js' file
Can someone help me start up my bot? its startup code looks something like this
const { Client, Events, GatewayIntentBits } = require('discord.js');
const { token } = require('./config.json');
const ...
0
votes
1
answer
28
views
Error: TypeError: user.send is not a function
I am trying a discord bot with a modal, I want to send a private message to the user, but an error appears like this
Error: TypeError: user.send is not a function
this is my code
const invoke = ...
0
votes
0
answers
44
views
Discord API responding with "Request failed with status code 401"
I am developing a discord servers list, the site itself is complete, but I am having major issues ever since switching to slash commands (requirement for verification, unless approved for Message ...
-1
votes
0
answers
25
views
Music discord bot isn't playing music
Here the code for my play.js file:
const { createAudioPlayer, createAudioResource, joinVoiceChannel, getVoiceConnection, AudioPlayerStatus } = require('@discordjs/voice');
const play = require('play-...
0
votes
0
answers
62
views
Discord bot wont play music
I made a discord bot thart play music and it works perfectly fine in the past few weeks but suddenly one day I tried to play a music and the bot joined the voice channel but it did not play any music. ...
0
votes
0
answers
11
views
Custom prefix command with discord.js in commands folder
below is the code of my ping.js file in commands folder as suggested on discord.js documentation, but instead of using Slash command builder I am using this below method(no specific reason for not ...
0
votes
0
answers
25
views
Discord Js V14 Setting permissions on channel not working as expected
when creating a channel with the bot i wanted originally to set the permissions for everyone to not see the channel but for a specific role to see it and for the person that used the command to see ...
-1
votes
2
answers
36
views
Error : Uncaught TypeError TypeError: Cannot read properties of undefined (reading 'FLAGS') Discord bot Discord.js V14
i just wanted that the bot if i interact with the button it will create a channel on the "ticket" category if there is no ticket category i verify if there is any category with the id that i ...
0
votes
0
answers
21
views
Discord error "Interaction has already been acknowledged"
I'm trying to make a discord bot which will track your hack club arcade sessions, but I am coming across the issue
Error [InteractionAlreadyReplied]: The reply to this interaction has already been ...
0
votes
1
answer
38
views
Discord bot is online - but not responding
I created a discord bot with replit in js. The bot has only one command, its to say pong when we say ping.
Here is my code:
require('dotenv').config(); // Assurez-vous que le fichier .env est chargé
...