X is not a constructor but works at other parts of the code?
Okay so im a little helpless here.
Im currently rebuilding my entire bot, and so decided to go for typescript and the newest discord.js version.
All good all fine, until i stumbled upon this issue, which will be described here:
I have a Class called "Command" that holds all the callbacks and variables needed for Command Registration later.
I have a Class called "CommandRegister" which will register Commands for the respective guilds.
I have a Class called "Localisation" which stores all translated strings for supported languages.
Now the issue: while looping through all guilds the bot is part of, and picking the preferredLocale of the guild, im attempting to translate the command (description) based on the locale.
However, whenever im attempting to create a new Localisation instance, keeps telling me that the "Localisation" is not a constructor, while im calling it in the same way in other parts of the bot without issues?`
In here in the provided and necessary code:
Im lowkey clueless, any help appreciated.
1 Reply
- 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