So I've been working with discord.js for a little while but whenever I type any discord related function/object, the intellisense proposition are totally unrelated or straight up missing. It's quite annoying and couldn't find why. Though it seems to work in the main file (index.js)
otherfile.js:
index.js:
What could the problem be?
I had the exact same problem. What fixed it for me? Actually switching to TypeScript. I set the client Type, to Client from discord.js, and now it is working. I know, it is not the easiest fix, but for sure one that works.
This should pretty much fix the issue
In other files, try adding this piece of code
const { Client } = require("discord.js") module.exports = { /** * * @param {Client} client */ }
You can import other classes like Message with the respective paramater (for eg: message).
If you're still confused, type client. and press CTRL + SPACEBAR at the same time. This will bring the drop down menu of options.