【发布时间】:2020-08-25 11:40:39
【问题描述】:
我希望在我发出命令时将消息发送到特定频道。如果命令未在特定通道上运行,我希望用户遇到错误。我需要你的帮助。
if (msg.author.bot) return;
if (msg.content.toLowerCase() === prefix + 'xgif' ) {
number = 100;
imageNumber = Math.floor (Math.random() * (number -1 + 1)) + 1;
client.channels.get(`channelID`).send( {files: ["./images/" + imageNumber + ".gif"]})
}
错误:TypeError: client.channels.get is not a function
【问题讨论】:
标签: javascript node.js discord discord.js