I don't know how Events works

So, i was trying to make events out of index and i don't know how to make them perfectlly, i tried using the info on docs, but it doesnt leave any error, just don't do anything.
32 Replies
d.js toolkit
d.js toolkit13mo ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
treble/luna
treble/luna13mo ago
^this and why do you have all the intents? Its not needed. Theres a number of reasons why your update event might not work, the most common ones being * The message might be a partial * The roles might not be cached * You might not have the Guilds intent (which i cannot see because you enabled all intents and srcbin wont let me scroll only enable the intents you need. They decrease resource usage
Dhymbot
Dhymbot13mo ago
at index i have all the intents because at the tutorial put them all, however its reasonable that im not using the most part of these
treble/luna
treble/luna13mo ago
delete the ones you are not using
Dhymbot
Dhymbot13mo ago
yeah, im doing it, thanks so, its better to make the messageUpdate on index.js? im going to use console.log() for searching if its detected
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
Dhymbot
Dhymbot13mo ago
ok
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
Dhymbot
Dhymbot13mo ago
srry if im a bit naive
Unknown User
Unknown User13mo ago
Message Not Public
Sign In & Join Server To View
Dhymbot
Dhymbot13mo ago
Ok, i made a few changes like what you said , but still i cannot log information on the module.export. New Index: https://sourceb.in/ScKpg0wvVW Old & New eventHandler: https://sourceb.in/PUsMjpZMtn New messageUpdate: https://sourceb.in/rNTLsjJvFD
treble/luna
treble/luna13mo ago
your console.log will error because you do not pass in a string
Dhymbot
Dhymbot13mo ago
omg i literally miss the '' fixed restarting
treble/luna
treble/luna13mo ago
i also dont really get why you use switch (folder) { case "client":
Dhymbot
Dhymbot13mo ago
i apologize if that's not the best way to do it, i used a tutorial and do that like showing at my code if this helps, the directories are like this.
index.js \functions | - \handlers | | -eventHandler \events | - \modlog | | -messageUpdate
treble/luna
treble/luna13mo ago
why do you have 2 functions folders
Dhymbot
Dhymbot13mo ago
im not focusing bruh im going to dinner, srry if i make more difficult the thing than it should be
treble/luna
treble/luna13mo ago
no worries. You appear to switch between folders and search for the client folder, only you dont have a client folder
Dhymbot
Dhymbot13mo ago
uhm, i think i have a client folder, if we mean to the same folder
Dhymbot
Dhymbot13mo ago
Dhymbot
Dhymbot13mo ago
wow, i passed to client folder and there is an error now. It's an advance im fixing the code with the errors thar are appearing however, im using the folder /home/container/events/client, how i can edit the handler for making for each folder? or why doesn't work? Code works perfectly on new folder ✅
treble/luna
treble/luna13mo ago
you should just put all your events in an event folder and then read them.with fs
Dhymbot
Dhymbot13mo ago
now i see
Dhymbot
Dhymbot13mo ago
Dhymbot
Dhymbot13mo ago
i think i can change the code with the example on docs, i don't wanna to limit the folders or making anything different
Dhymbot
Dhymbot13mo ago
also this default seems the thing that should apply for a default folder not specified
treble/luna
treble/luna13mo ago
default is just what your switch would do if none of your cases match
Dhymbot
Dhymbot13mo ago
that is what i mean
treble/luna
treble/luna13mo ago
But you shouldn't blindly follownthe docs
Dhymbot
Dhymbot13mo ago
yes the code im using is from a tutorial at the actual bot, not the docs, just wanna see it for knowing how discordjs web examples did it i delete the switch, now it's working thnx!