How to setup constants/variables outside of module.exports ?

Look at the image. I want to use the RateLimiter inside the command's run-function but I need to set it up somehow since I'm doing require() to import the file - which is only considering module.exports and not the ratelimiter... How can I fix this?
const reportWebhookUpdate = new RateLimiterMemory(...);

module.exports = {
ignore: true,
data: new SlashCommandBuilder() ...,
run: asnyc () => {},
}
const reportWebhookUpdate = new RateLimiterMemory(...);

module.exports = {
ignore: true,
data: new SlashCommandBuilder() ...,
run: asnyc () => {},
}
could I try to put the limiter in module.exports and use this.limiter in the function?
No description
4 Replies
Syjalo
Syjalo4mo ago
I don't see any issues using it the way you shown. Bwt not related to discord.js #other-js-ts
LukeZ
LukeZOP4mo ago
I don't see any issues using it the way you shown.
Which one do you mean exactly? trying to put it in module.exports or the image?
Bwt not related to discord.js
ok, sry
Syjalo
Syjalo4mo ago
the image
LukeZ
LukeZOP4mo ago
okay, will try it 👍🏻
Want results from more Discord servers?
Add your server