Command Not Reloading

Hey, I'm having an issue where, after using the reload command the bot is still referencing the old message. although when I log the event I'm seeing the updated code with the changes I made. I'm using typescript & CommonJS while transpilng
16 Replies
d.js toolkit
d.js toolkit3mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
Amgelo
Amgelo3mo ago
are you editing the typescript or javascript file?
TheAltSyst
TheAltSystOP3mo ago
Javascript file
TheAltSyst
TheAltSystOP3mo ago
No description
Amgelo
Amgelo3mo ago
can you show your event manager as in, how client.events works
TheAltSyst
TheAltSystOP3mo ago
alright, lemme send it https://pastebin.com/hWydj147 - The Event Handler Function https://pastebin.com/3EsCcrTR - GetFiles Function https://pastebin.com/nTABXLFw - My client constructor for event collection reference
Amgelo
Amgelo3mo ago
and where do you call HandleEvents?
TheAltSyst
TheAltSystOP3mo ago
In my index.ts file
No description
Amgelo
Amgelo3mo ago
you don't seem to actually do something with client.events
TheAltSyst
TheAltSystOP3mo ago
I have noted it for a plan, but currently yeah
Amgelo
Amgelo3mo ago
all your event logic is here, which is loaded on that HandleEvents function
No description
Amgelo
Amgelo3mo ago
the client event emitter will still have the old event since you're only updating client.events you could rework your event logic so it actually uses the client.events collection and that way you only need to update that
TheAltSyst
TheAltSystOP3mo ago
I was just saving the collection for a help command, so what should i do currently?. can you provide me an reference
Amgelo
Amgelo3mo ago
well you could either just make a function that clears the emitter and iterates through the collection something like "ReloadEvents" or one that only reloads a specific event it'd pretty much be only to (un)listen to old/new events since your event handler on client.on would get the event from the collection and run it so it'll always get the most "up to date version"
TheAltSyst
TheAltSystOP3mo ago
Alright Got It, Thank you 🫶
Want results from more Discord servers?
Add your server