简体   繁体   中英

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:)

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM