#+) Typescript autocomplete

33 messages · Page 1 of 1 (latest)

oak creek
#
client.on('messageCreate', (message:Message) => {
    console.log(message.content) // It returns ''
});

Does anyone know why this is?

tropic gustBOT
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

knotty flint
#

you need to enable message content intent

oak creek
#

(new Client({intents: [32767], partials: ['CHANNEL']}

#

Is '32767' not the master permission?

knotty flint
#

no.

#

never was, never will be, as there is no concept of "this intent is everything"

oak creek
#

oops..! thx,

knotty flint
#

don't use magic numbers

oak creek
#

I tried using const , but it didn't work. Will be corrected soon

knotty flint
#

no, making it js const intents = 32767 new Client({ intents: intents })does not count as not using magic numbers

#

use the enums we provide to have way better and actually readable way of providing intents

oak creek
#

With intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent],

#

fixed

#

Thx!

#

++
Autocomplete isn't as good in Typescript as in JavaScript.
@wooden canopyes doesn't seem to exist, is there any way?

#

+) Typescript autocomplete

knotty flint
#

the autocomplete in typescript is at least order of magnitude better than for javscript, even if in vsc both run on technically same thing

oak creek
#

I use intelij

knotty flint
#

yeah, that might be the issue

#

not typescript

oak creek
#

but it doesn't work well..

knotty flint
#

yeah, intellij doesn't work well, not typescript

#

use vsc instead

oak creek
#

But if I change the extension to .js it works better

knotty flint
#

...

oak creek
#

Normal nodejs not discordjs works fine

knotty flint
#

there are countless people even in this server that have issues with intellij being garbage with typescript

#

it not resolving types and whatnot

oak creek
#

umm

#

ok