【发布时间】:2021-06-01 12:04:15
【问题描述】:
module.exports = {
prefix: "!apply",
fn: (msg) => {
let application = {}
let filter = (msg) => !msg.author.bot
let options = {
max: 1,
time: 1500
}
msg.member.send("Which item do you want to sell")
.then(dm => {
return dm.channel.awaitMessages(filter,options)
})
.then(collected => {
application.name = collected.array()[0].content;
return msg.member.send("Got it, now whats your Discord [ex: Vouchy#0001]")
})
.then(dm => {
return dm.channel.awaitMessages(filter,options)
})
.then(collected => {
application.tag = collected.array()[0].content;
return msg.member.send('Excellent, Finally, tell us how much you\'re willing to sell it for')
})
.then(dm => {
return dm.channel.awaitMessages(filter,options)
})
.then(collected => {
application.pitch = collect.array()[0].content;
console.log(application)
})
}
}
我试图创建一个不和谐的应用程序,当用户执行 !apply 时,它会向他们发送一条消息并要求他们回答这些问题。
【问题讨论】:
-
我在
Collection#array上找不到任何文档,您的意思是不是Collection#toArray? (.toArray())
标签: javascript arrays discord.js