dms not registering as a dm
hey, ive been trying to make this code from like a year ago work, but the channeltype.dm doesnt seem to be working -
24 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 OPWhat do you mean by "does not seem to work"?
Does it not pass your if statement? Do you get an error?
my discord.js is v14.14.1
nothing at all
doesnt log, doenst error
well i guess the logging part is my fault
cus no debug
but im kinda rusty at djs rn
does your client.handleDM event fire at all? if you log outside your if statement do you get anything?
yes, if i do !=== channeltype.dm it sends the debug message
can you
console.log(message.channel.type)
?it doesnt log anything when in dms but logs 0 in text channels
and im pretty sure i have partials
this is my bot.js
it doesnt log anything? did you put the console log outside the if statement?
wait is there a partial for dms?
yeah
beneath the webhook client but outside the if statement
ok, so thats not the problem
You could try updating to latest 14.17.3. couldn't hurt.
in case its a bug or something w/ djs
sure, lemme try
ok im on 14.17.3
lemme try
still nothing
also can you try logging just
message
for dm messages? curious if that logs anything. since it doesnt error on message.channel.type
, that would mean message
and message.channel
are definednothing when dm
but the full json when msg
hmm
what happens if you replace
with
makes me think its not even reaching the logging point. strange
yeah
STILL nothing
with !message.guild
then its just not running that code it seems
exactly
but when its a normal message everything is fine
its strange
in theory there should be nothing wrong
its like it cant even see the dms
missing DirectMessages intent
WHY-
BRUHHH
oh the intent 😭 😭 😭 why didnt i think of that
why is there an intent for it 😭
when i coded this there wasnt one
bru-
well thanks
last yea
r
but it worked before
so idk