【发布时间】:2019-05-02 23:35:04
【问题描述】:
每当有新用户加入服务器(公会)时,我想向“欢迎”文本频道发送问候消息。
我面临的问题是,当我找到想要的频道时,我会收到GuildChannel类型的频道。
由于GuildChannel 没有send() 功能,我无法发送消息。但是我找不到找到TextChannel 的方法,所以我被困在这里。
如何访问TextChannel 以便能够使用send() 消息?在我现在使用的代码下方:
// Get the log channel (change to your liking)
const logChannel = guild.channels.find(123456);
if (!logChannel) return;
// A real basic message with the information we need.
logChannel.send('Hello there!'); // Property 'send' does not exist on type 'GuildChannel'
我正在使用 11.3.0 版的 discord.js
【问题讨论】:
标签: node.js typescript discord.js