14 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 OPYou're likely not passing your client into your
execute()
function for your event handler, nor do you really need to since just about all d.js structures have a client
propertyThen why doesn't it work? I don't understand the problem
My first sentence explains why your code is not functioning
So I don't need to pass 'client'? Because all DJs have one? That's what I read.
Correct, just use
oldChannel.client
Or newChannel
, doesn't matter since both are channel instances that have itok and how do I access a channel within the event so that I can send a message?
Assuming you have the Guilds intent,
<Client>.channels.cache.get(channelId)
to get the channel you wantI'm asking because the original goal was to send a message in a channel when someone creates a new channel. However, I was never able to access the channel list. So I wanted to work on it bit by bit.
And with oldchannel before?
To get to the Client, yes
aaaaaaaah .. I understand .. pretty easy ..
Thank you so Mitch
Mutch