user10277806
user10277806

Reputation:

Discord.js searching for specific channel name to send a message to(logs)

im tryna make it so when the mute command is used it sends the feedback to the logs channel if theres a logs channel heres my code

let logs = Client.channels.find(ch => ch.name = 'logs')

logs.send(embed)

it works but instead of sending to my #logs it sends to my #video-suggestions (i ran the command in #bot-setup)

visual

any help is apreciated :)

Upvotes: 1

Views: 95

Answers (1)

Androz2091
Androz2091

Reputation: 3005

You should use

var logs = Client.channels.find(ch => ch.name === "logs");

instead of:

var logs = Client.channels.find(ch => ch.name = "logs");

To compare two values, use == or === and use = to assign a value to a variable.

Upvotes: 1

Related Questions