我想让我的机器人能够发布到 Discord.com 最近在整个平台上全球推出的新 ANNOUNCMENTS_CHANNEL 功能,但是,discord.js 文档对此功能的描述非常简单,无论他们如何声明NewsChannel extends TextChannel。我知道这确实有一个.send()但不确定如何确认它NewsChannel是一个在创建社区公会时激活的活跃公告渠道。我希望得到一些关于如何进行的提示和建议。
1 回答

撒科打诨
TA贡献1934条经验 获得超2个赞
如果要确保该频道是公告频道,请检查频道类型“新闻”。这样,您就可以轻松地将消息发送到该通道,就像通常使用普通文本通道一样。
let channel = message.mentions.channels.firts()
// ^^ An option if you are getting the channel from a mention in the message
if (channel.type !== "news") return
channel.send("your message")
添加回答
举报
0/150
提交
取消