import "client" into separate function files
im creating a heat system and with this im adding automatic punishments so i want to make separate files like a "ban.js" thatll take in specific arguments and perform the ban action there to save space in other files.
i have the function setup to work in other files however im not sure how to go about importing the discord client so i can actually do the ban. i cant do it the typical
module.exports = (client) => {}
because i have to export the BanMember function.
function code here:
BanMember.ban();
being the function that will be used in the other files to execute the ban8 Replies
- 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 OPplease ping if you respond
@dezπ¦ pass the client as a parameter in the constructor of the BanMember or the
ban()
methodoh it as easy as
?
Yep..
somehow i didnt think of that π
Also this is not djs related, so make sure to utilize #other-js-ts for issues like this
got confused what this would classify as so figured here
thanks anyways