user13898619
user13898619

Reputation:

how to send a message to a specific channel using discord.js

This seems like it should be easy, but I can't figure out how to do this. I have a module that when it is executed it is supposed to send a message to a specific channel, but it does not.

I have tried:

client.channels.cache.get('771081627768979516').send('test')
   

as well as

let channel = message.guild.channels.cache.get(c => c.name === '#logs')
channel.send('test')

(using both logs and #logs)

I can't figure out how to get this to work.

Upvotes: 1

Views: 74

Answers (1)

user13898619
user13898619

Reputation:

the function was not getting called right -_-

Upvotes: 1

Related Questions