简体   繁体   中英

How to get the channel of a message

I want to get the channel of a message send by an user, I have that

client.on('message', msg => {

But I don't how to get the channel, how can I do?

The msg object returned follows the Message format you can find in the Discord.js documentation.

Hence, you can get the channel the message was sent on by msg.channel , and its name msg.channel.name .

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