【发布时间】:2021-05-14 21:14:08
【问题描述】:
所以我想要做的是,我的不和谐机器人侦听附件然后将它们发送到特定频道,我希望它也能与 ????和 ????现在我看到了一些解决方案,但它们需要消息 ID 和频道 ID,我的频道 ID 将保持不变,但每次我发送附件时我的消息 ID 都会改变我如何制作它以便它对进入该频道的附件做出反应
我的代码:-
client.on("message", async message => {
message.attachments.forEach((attachment) => {
if (attachment.width && attachment.height) {
if (message.author.bot) return
let yes = attachment
const channel = client.channels.cache.find(channel => channel.name === "llllllounge")
channel.send(yes)
.then(() => attachment.react('????'))
.then(() => attachment.react('????'))
}
});
})
我尝试过yes.react('????'),但它不起作用并回复yes.react is not a function
如果有人帮助我,将不胜感激。
【问题讨论】:
标签: node.js discord.js