1 回答

TA貢獻(xiàn)1817條經(jīng)驗(yàn) 獲得超14個贊
首先,您可以在對象中聲明消息,然后使用它們發(fā)送到不同的渠道。
//Here goes the dynamic setting for different channels
const messages = {
'IdChannel':{
embed:{
title:'foo',
description: message.content,
footer: {text:'foo'}
}
},
'scndChannelID':{
embed:{
title:'bar',
description: message.content,
footer: {text:'bar'}
}
}
}
然后在事件消息上使用它發(fā)送到您需要在對象鍵上聲明的通道
Object.keys(messagex).forEach((value,index) => {
//Here can go the static things
message.guild.channels.cache.get(value).send(
{embed:{...messagex[value].embed,
timestamp: new Date(),
image: {url:""}
}})
})
添加回答
舉報